本文整理汇总了PHP中tribe_is_day函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_is_day函数的具体用法?PHP tribe_is_day怎么用?PHP tribe_is_day使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_is_day函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dt_the_events_calendar_template_config
/**
* Theme basic config.
*
* @see https://gist.github.com/jo-snips/2415009
*/
function dt_the_events_calendar_template_config()
{
// detect calendar pages
if (tribe_is_month() && !is_tax() || tribe_is_month() && is_tax() || (tribe_is_past() || tribe_is_upcoming() && !is_tax()) || (tribe_is_past() || tribe_is_upcoming() && is_tax()) || tribe_is_day() && !is_tax() || tribe_is_day() && is_tax() || tribe_is_event() && is_single() || tribe_is_venue() || function_exists('tribe_is_week') && tribe_is_week() || function_exists('tribe_is_photo') && tribe_is_photo() || function_exists('tribe_is_map') && tribe_is_map() || get_post_type() == 'tribe_organizer' && is_single()) {
// remove theme title controller
remove_action('presscore_before_main_container', 'presscore_page_title_controller', 16);
}
}
示例2: day_view_ical_link
/**
* Make sure ical link has the date in the URL instead of "today" on day view
*
* @param $link
*
* @return string
*/
public static function day_view_ical_link($link)
{
if (tribe_is_day()) {
global $wp_query;
$day = $wp_query->get('start_date');
$link = trailingslashit(esc_url(trailingslashit(tribe_get_day_link($day)) . '?ical=1'));
}
return $link;
}
示例3: collapse_sql
/**
* Collapses subsequent recurrence records when appropriate (ie, for multi-post type queries where
* the "Recurring event instances"/show-only-the-first-upcoming-recurring-event setting is enabled).
*
* In those situations where we do need to intervene and collapse recurring events, we re-jigger
* the SQL statement so the GROUP BY collapses records in the expected manner.
*
* @param string $sql The current SQL statement
* @param WP_Query $query WP Query object
*
* @return string The new SQL statement
*/
public static function collapse_sql($sql, $query)
{
global $wpdb;
// For month, week and day views we don't want to apply this logic - unless the current query
// belongs to a widget and just happens to be running inside one of those views
if (!isset($query->query_vars['is_tribe_widget']) || !$query->query_vars['is_tribe_widget']) {
if (tribe_is_month() || tribe_is_week() || tribe_is_day()) {
return $sql;
}
}
// If this is not an event query/a multi post type query there is no need to interfere
if (empty($query->tribe_is_event) && empty($query->tribe_is_multi_posttype)) {
return $sql;
}
// If the hide-recurring-events setting is not set/is false we do not need to interfere
if (!isset($query->query_vars['tribeHideRecurrence']) || !$query->query_vars['tribeHideRecurrence']) {
return $sql;
}
// If looking just for fields then let's replace the .ID with *
if ($query->query_vars['fields'] == 'ids') {
$sql = preg_replace("/(^SELECT\\s+DISTINCT\\s{$wpdb->posts}.)(ID)/", "\$1*, {$wpdb->postmeta}.meta_value as 'EventStartDate'", $sql);
}
if ($query->query_vars['fields'] == 'id=>parent') {
$sql = preg_replace("/(^SELECT\\s+DISTINCT\\s{$wpdb->posts}.ID,\\s{$wpdb->posts}.post_parent)/", "\$1, {$wpdb->postmeta}.meta_value as 'EventStartDate'", $sql);
}
// We need to relocate the SQL_CALC_FOUND_ROWS to the outer query
$sql = preg_replace('/SQL_CALC_FOUND_ROWS/', '', $sql);
// We don't want to grab the min EventStartDate or EventEndDate because without a group by that collapses everything
$sql = preg_replace('/MIN\\((' . $wpdb->postmeta . '|tribe_event_end_date).meta_value\\) as Event(Start|End)Date/', '$1.meta_value as Event$2Date', $sql);
// Let's get rid of the group by (non-greedily stop before the ORDER BY or LIMIT)
$sql = preg_replace('/GROUP BY .+?(ORDER|LIMIT)/', '$1', $sql);
// Once this becomes an inner query we need to avoid duplicating the post_date column (which will
// otherwise be returned once from wp_posts.* and once as an alias)
$sql = str_replace('AS post_date', 'AS EventStartDate', $sql);
// The outer query should order things by EventStartDate in the same direction the inner query does by post date:
preg_match('/[\\s,](?:EventStartDate|post_date)\\s+(DESC|ASC)/', $sql, $direction);
$direction = isset($direction[1]) && 'DESC' === $direction[1] ? 'DESC' : 'ASC';
// Let's extract the LIMIT. We're going to relocate it to the outer query
$limit_regex = '/LIMIT\\s+[0-9]+(\\s*,\\s*[0-9]+)?/';
preg_match($limit_regex, $sql, $limit);
if ($limit) {
$sql = preg_replace($limit_regex, '', $sql);
$limit = $limit[0];
} else {
$limit = '';
}
$group_clause = $query->query_vars['fields'] == 'id=>parent' ? 'GROUP BY ID' : 'GROUP BY IF( post_parent = 0, ID, post_parent )';
return '
SELECT
SQL_CALC_FOUND_ROWS *
FROM (
' . $sql . "\n\t\t\t) a\n\t\t\t{$group_clause}\n\t\t\tORDER BY EventStartDate {$direction}\n\t\t\t{$limit}\n\t\t";
}
示例4: grve_events_calendar_is_overview
/**
* Helper function to check if is Events Calendar Overview Page
*/
function grve_events_calendar_is_overview()
{
if (grve_events_calendar_enabled()) {
if (tribe_is_list_view() || tribe_is_day() || tribe_is_month()) {
return true;
}
}
if (grve_events_calendar_pro_enabled()) {
if (tribe_is_week() || tribe_is_map() || tribe_is_photo()) {
return true;
}
}
return false;
}
示例5: filter_events_title
function filter_events_title($title)
{
if (tribe_is_month() && !is_tax()) {
// Month View Page
$title = 'Events - Month view page | Czech and Slovak Club Tauranga';
} elseif (tribe_is_month() && is_tax()) {
// Month View Category Page
$title = 'Events - Month view category page | Czech and Slovak Club Tauranga';
} elseif (tribe_is_upcoming() && !is_tax()) {
// List View Page: Upcoming Events
$title = 'Events - Upcoming events page | Czech and Slovak Club Tauranga';
} elseif (tribe_is_upcoming() && is_tax()) {
// List View Category Page: Upcoming Events
$title = 'Events - Upcoming events page | Czech and Slovak Club Tauranga';
} elseif (tribe_is_past() && !is_tax()) {
// List View Page: Past Events
$title = 'Events - Past events page | Czech and Slovak Club Tauranga';
} elseif (tribe_is_past() && is_tax()) {
// List View Category Page: Past Events
$title = 'Events - Category: Past events page | Czech and Slovak Club Tauranga';
} elseif (tribe_is_week() && !is_tax()) {
// Week View Page
$title = 'Events - Week view page | Czech and Slovak Club Tauranga';
} elseif (tribe_is_week() && is_tax()) {
// Week View Category Page
$title = 'Events - Week view category page | Czech and Slovak Club Tauranga';
} elseif (tribe_is_day() && !is_tax()) {
// Day View Page
$title = 'Events - Day view page | Czech and Slovak Club Tauranga';
} elseif (tribe_is_day() && is_tax()) {
// Day View Category Page
$title = 'Events - Day view category page | Czech and Slovak Club Tauranga';
} elseif (tribe_is_map() && !is_tax()) {
// Map View Page
$title = 'Events - Map view page | Czech and Slovak Club Tauranga';
} elseif (tribe_is_map() && is_tax()) {
// Map View Category Page
$title = 'Events - Map view category page | Czech and Slovak Club Tauranga';
} elseif (tribe_is_photo() && !is_tax()) {
// Photo View Page
$title = 'Events - Photo view page | Czech and Slovak Club Tauranga';
} elseif (tribe_is_photo() && is_tax()) {
// Photo View Category Page
$title = 'Events - Photo view category page | Czech and Slovak Club Tauranga';
}
return $title;
}
示例6: mfn_breadcrumbs
function mfn_breadcrumbs($class = false)
{
global $post;
$translate['home'] = mfn_opts_get('translate') ? mfn_opts_get('translate-home', 'Home') : __('Home', 'betheme');
$homeLink = home_url();
$separator = ' <span><i class="icon-right-open"></i></span>';
// Plugin | bbPress -----------------------------------
if (function_exists('is_bbpress') && is_bbpress()) {
bbp_breadcrumb(array('before' => '<ul class="breadcrumbs">', 'after' => '</ul>', 'sep' => '<i class="icon-right-open"></i>', 'crumb_before' => '<li>', 'crumb_after' => '</li>', 'home_text' => $translate['home']));
return true;
}
// end: bbPress -------------------------------------
// Default breadcrumbs --------------------------------
$breadcrumbs = array();
// Home prefix --------------------------------
$breadcrumbs[] = '<a href="' . $homeLink . '">' . $translate['home'] . '</a>';
// Blog -------------------------------------------
if (get_post_type() == 'post') {
$blogID = false;
if (get_option('page_for_posts')) {
$blogID = get_option('page_for_posts');
// Setings / Reading
} elseif (mfn_opts_get('blog-page')) {
$blogID = mfn_opts_get('blog-page');
// Theme Options / Getting Started / Blog
}
if ($blogID) {
$breadcrumbs[] = '<a href="' . get_permalink($blogID) . '">' . get_the_title($blogID) . '</a>';
}
}
// Plugin | Events Calendar -------------------------------------------
if (function_exists('tribe_is_month') && (tribe_is_event_query() || tribe_is_month() || tribe_is_event() || tribe_is_day() || tribe_is_venue())) {
if (function_exists('tribe_get_events_link')) {
$breadcrumbs[] = '<a href="' . tribe_get_events_link() . '">' . tribe_get_events_title() . '</a>';
}
} elseif (is_front_page() || is_home()) {
// do nothing
// Blog | Tag -------------------------------------
} elseif (is_tag()) {
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . single_tag_title('', false) . '</a>';
// Blog | Category --------------------------------
} elseif (is_category()) {
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . single_cat_title('', false) . '</a>';
// Blog | Author ----------------------------------
} elseif (is_author()) {
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . get_the_author() . '</a>';
// Blog | Day -------------------------------------
} elseif (is_day()) {
$breadcrumbs[] = '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a>';
$breadcrumbs[] = '<a href="' . get_month_link(get_the_time('Y'), get_the_time('m')) . '">' . get_the_time('F') . '</a>';
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . get_the_time('d') . '</a>';
// Blog | Month -----------------------------------
} elseif (is_month()) {
$breadcrumbs[] = '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a>';
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . get_the_time('F') . '</a>';
// Blog | Year ------------------------------------
} elseif (is_year()) {
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . get_the_time('Y') . '</a>';
// Single -----------------------------------------
} elseif (is_single() && !is_attachment()) {
// Custom Post Type -----------------
if (get_post_type() != 'post') {
$post_type = get_post_type_object(get_post_type());
$slug = $post_type->rewrite;
$portfolio_page_id = mfn_wpml_ID(mfn_opts_get('portfolio-page'));
// Portfolio Page ------------
if ($slug['slug'] == mfn_opts_get('portfolio-slug', 'portfolio-item') && $portfolio_page_id) {
$breadcrumbs[] = '<a href="' . get_page_link($portfolio_page_id) . '">' . get_the_title($portfolio_page_id) . '</a>';
}
// Category ----------
if ($portfolio_page_id) {
$terms = get_the_terms(get_the_ID(), 'portfolio-types');
if (!empty($terms) && !is_wp_error($terms)) {
$term = $terms[0];
$breadcrumbs[] = '<a href="' . get_term_link($term) . '">' . $term->name . '</a>';
}
}
// Single Item --------
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . get_the_title() . '</a>';
// Blog | Single --------------------
} else {
$cat = get_the_category();
if (!empty($cat)) {
$breadcrumbs[] = get_category_parents($cat[0], true, $separator);
}
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . get_the_title() . '</a>';
}
// Taxonomy ---------------------------------------
} elseif (!is_page() && get_post_taxonomies()) {
// Portfolio ------------------------
$post_type = get_post_type_object(get_post_type());
if ($post_type->name == 'portfolio' && ($portfolio_page_id = mfn_wpml_ID(mfn_opts_get('portfolio-page')))) {
$breadcrumbs[] = '<a href="' . get_page_link($portfolio_page_id) . '">' . get_the_title($portfolio_page_id) . '</a>';
}
$breadcrumbs[] = '<a href="' . curPageURL() . '">' . single_cat_title('', false) . '</a>';
// Page with parent -------------------------------
} elseif (is_page() && $post->post_parent) {
$parent_id = $post->post_parent;
$parents = array();
while ($parent_id) {
//.........这里部分代码省略.........
示例7: miss_page_title
/**
*
*/
function miss_page_title()
{
global $irish_framework_params, $wp_query;
if (is_front_page()) {
return;
}
if (miss_is_template('templates/template-home.php')) {
return;
}
$post_obj = $wp_query->get_queried_object();
if (!empty($post_obj) && !empty($post_obj->ID) && get_post_meta($post_obj->ID, '_disable_page_title', true)) {
return;
}
$title = '';
if (is_404()) {
$title = __('The requested page could not be found', MISS_TEXTDOMAIN);
$page_tagline = __('Error 404', MISS_TEXTDOMAIN);
}
/**
* Events Calendar PRO Support
*
* @since 1.8
*/
if (class_exists('TribeEventsPro')) {
if (function_exists('tribe_is_month') && tribe_is_month()) {
$title = __('Events for', MISS_TEXTDOMAIN);
$page_tagline = Date("F Y", strtotime($wp_query->get('start_date')));
}
if (function_exists('tribe_is_day') && tribe_is_day()) {
$title = __('Events for', MISS_TEXTDOMAIN);
$page_tagline = Date("l, F jS Y", strtotime($wp_query->get('start_date')));
}
if (function_exists('tribe_is_week') && tribe_is_week()) {
if (function_exists('tribe_get_first_week_day')) {
$title = sprintf(__('Events for week of %s', MISS_TEXTDOMAIN), Date("l, F jS Y", strtotime(tribe_get_first_week_day($wp_query->get('start_date')))));
}
$page_tagline = '';
}
if (function_exists('tribe_is_map') && tribe_is_map() || function_exists('tribe_is_photo') && tribe_is_photo()) {
if (tribe_is_past()) {
$title = __('Past Events', MISS_TEXTDOMAIN);
} else {
$title = __('Upcoming Events', MISS_TEXTDOMAIN);
}
$page_tagline = '';
}
if (function_exists('tribe_is_showing_all') && tribe_is_showing_all()) {
$title = sprintf('%s %s', __('All events for', MISS_TEXTDOMAIN), get_the_title());
$page_tagline = '';
}
}
$intro_options = miss_get_setting('intro_options');
if (is_search()) {
$title = sprintf(__('Search Results for: %1$s', MISS_TEXTDOMAIN), '‘' . get_search_query() . '’');
} elseif (is_category()) {
$title = sprintf(__('Category Archive for: %1$s', MISS_TEXTDOMAIN), '‘' . single_cat_title('', false) . '’');
} elseif (is_archive() || is_singular('post')) {
$title = sprintf(__('%1$s', MISS_TEXTDOMAIN), miss_get_setting(get_post_type() . '_page_caption') ? miss_get_setting(get_post_type() . '_page_caption') : get_post_type());
} elseif (is_tag()) {
$title = sprintf(__('All Posts Tagged Tag: %1$s', MISS_TEXTDOMAIN), '‘' . single_tag_title('', false) . '’');
} elseif (is_day()) {
$title = sprintf(__('Daily Archive for: %1$s', MISS_TEXTDOMAIN), '‘' . get_the_time('F jS, Y') . '’');
} elseif (is_month()) {
$title = sprintf(__('Monthly Archive for: %1$s', MISS_TEXTDOMAIN), '‘' . get_the_time('F, Y') . '’');
} elseif (is_year()) {
$title = sprintf(__('Yearly Archive for: %1$s', MISS_TEXTDOMAIN), '‘' . get_the_time('Y') . '’');
} elseif (is_singular('portfolio')) {
$gallery_id = miss_get_setting('portfolio_page');
if (!empty($gallery_id)) {
$title = get_the_title($gallery_id);
}
} elseif (function_exists('is_woocommerce') && is_woocommerce()) {
$shop_page = get_post(woocommerce_get_page_id('shop'));
$title = miss_get_setting('store_title') ? get_option('store_title') : (get_option('woocommerce_shop_page_title') ? get_option('woocommerce_shop_page_title') : __('Store', MISS_TEXTDOMAIN));
$page_tagline = miss_get_setting('product_page_tagline') ? get_option('product_page_tagline') : '';
} elseif (is_author()) {
global $author;
$curauth = get_userdata(intval($author));
$title = sprintf(__('Author Archive for: %1$s', MISS_TEXTDOMAIN), '‘' . $curauth->nickname . '’');
if (is_search()) {
$title = printf(__('Search Results: “%s”', MISS_TEXTDOMAIN), get_search_query());
} elseif (is_tax()) {
$title = single_term_title("", false);
} else {
$shop_page = get_post(woocommerce_get_page_id('shop'));
$title = miss_get_setting('store_title') ? get_option('store_title') : (get_option('woocommerce_shop_page_title') ? get_option('woocommerce_shop_page_title') : __('Store', MISS_TEXTDOMAIN));
$page_tagline = miss_get_setting('product_page_tagline') ? get_option('product_page_tagline') : '';
}
}
if (!empty($title)) {
if (!empty($page_tagline)) {
$page_tagline = '<span class="page_tagline">' . $page_tagline . '</span>';
$title .= $page_tagline;
}
return '<h1 class="page_title">' . $title . '</h1>';
} else {
global $wp_query;
//.........这里部分代码省略.........
示例8: tribe_get_events_title
/**
* Event Title
*
* Return an event's title with pseudo-breadcrumb if on a category
*
* @param bool $depth include linked title
*
* @return string title
* @todo move logic to template classes
*/
function tribe_get_events_title($depth = true)
{
$events_label_plural = tribe_get_event_label_plural();
global $wp_query;
$tribe_ecp = Tribe__Events__Main::instance();
$title = sprintf(__('Upcoming %s', 'tribe-events-calendar'), $events_label_plural);
// If there's a date selected in the tribe bar, show the date range of the currently showing events
if (isset($_REQUEST['tribe-bar-date']) && $wp_query->have_posts()) {
if ($wp_query->get('paged') > 1) {
// if we're on page 1, show the selected tribe-bar-date as the first date in the range
$first_event_date = tribe_get_start_date($wp_query->posts[0], false);
} else {
//otherwise show the start date of the first event in the results
$first_event_date = tribe_event_format_date($_REQUEST['tribe-bar-date'], false);
}
$last_event_date = tribe_get_end_date($wp_query->posts[count($wp_query->posts) - 1], false);
$title = sprintf(__('%1$s for %2$s - %3$s', 'tribe-events-calendar'), $events_label_plural, $first_event_date, $last_event_date);
} elseif (tribe_is_past()) {
$title = sprintf(__('Past %s', 'tribe-events-calendar'), $events_label_plural);
}
if (tribe_is_month()) {
$title = sprintf(__('%1$s for %2$s', 'tribe-events-calendar'), $events_label_plural, date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())));
}
// day view title
if (tribe_is_day()) {
$title = sprintf(__('%1$s for %2$s', 'tribe-events-calendar'), $events_label_plural, date_i18n(tribe_get_date_format(true), strtotime($wp_query->get('start_date'))));
}
if (is_tax($tribe_ecp->get_event_taxonomy()) && $depth) {
$cat = get_queried_object();
$title = '<a href="' . esc_url(tribe_get_events_link()) . '">' . $title . '</a>';
$title .= ' › ' . $cat->name;
}
return apply_filters('tribe_get_events_title', $title, $depth);
}
示例9: fitclub_is_tribe_page
function fitclub_is_tribe_page()
{
wp_reset_postdata();
//reset custom query
if (class_exists('TRIBE__EVENTS__MAIN')) {
if (tribe_is_month() && !is_tax()) {
// Month View Page
return true;
} elseif (tribe_is_month() && is_tax()) {
// Month View Category Page
return true;
} elseif (tribe_is_past() || tribe_is_upcoming() && !is_tax()) {
// List View Page
return true;
} elseif (tribe_is_past() || tribe_is_upcoming() && is_tax()) {
// List View Category Page
return true;
} elseif (tribe_is_day() && !is_tax()) {
// Day View Page
return true;
} elseif (tribe_is_day() && is_tax()) {
// Day View Category Page
return true;
} elseif (tribe_is_event() && is_single()) {
// Single Events
return true;
}
}
return false;
}
示例10: set_notices
/**
* Set up the notices for this template
*
* @return void
* @since 3.0
**/
public function set_notices()
{
global $wp_query;
// Look for a search query
if (!empty($wp_query->query_vars['s'])) {
$search_term = $wp_query->query_vars['s'];
} else {
if (!empty($_POST['tribe-bar-search'])) {
$search_term = $_POST['tribe-bar-search'];
}
}
// Search term based notices
if (!empty($search_term) && !have_posts()) {
TribeEvents::setNotice('event-search-no-results', sprintf(__('There were no results found for <strong>"%s"</strong>.', 'tribe-events-calendar'), esc_html($search_term)));
} else {
if (empty($search_term) && empty($wp_query->query_vars['s']) && !have_posts()) {
// Messages if currently no events, and no search term
$tribe_ecp = TribeEvents::instance();
$is_cat_message = '';
if (is_tax($tribe_ecp->get_event_taxonomy())) {
$cat = get_term_by('slug', get_query_var('term'), $tribe_ecp->get_event_taxonomy());
if (tribe_is_upcoming()) {
$is_cat_message = sprintf(__('listed under %s. Check out past events for this category or view the full calendar.', 'tribe-events-calendar'), esc_html($cat->name));
} else {
if (tribe_is_past()) {
$is_cat_message = sprintf(__('listed under %s. Check out upcoming events for this category or view the full calendar.', 'tribe-events-calendar'), esc_html($cat->name));
}
}
}
if (tribe_is_day()) {
TribeEvents::setNotice('events-not-found', sprintf(__('No events scheduled for <strong>%s</strong>. Please try another day.', 'tribe-events-calendar'), date_i18n('F d, Y', strtotime(get_query_var('eventDate')))));
} elseif (tribe_is_upcoming()) {
$date = date('Y-m-d', strtotime($tribe_ecp->date));
if ($date == date('Y-m-d')) {
TribeEvents::setNotice('events-not-found', __('No upcoming events ', 'tribe-events-calendar') . $is_cat_message);
} else {
TribeEvents::setNotice('events-not-found', __('No matching events ', 'tribe-events-calendar') . $is_cat_message);
}
} elseif (tribe_is_past()) {
TribeEvents::setNotice('events-past-not-found', __('No previous events ', 'tribe-events-calendar') . $is_cat_message);
}
}
}
}
示例11: setup_date_search_in_bar
/**
* Set up the date search in the tribe events bar.
*
* @param array $filters The current filters in the bar array.
*
* @return array The modified filters array.
*/
public function setup_date_search_in_bar($filters)
{
global $wp_query;
$value = apply_filters('tribe-events-bar-date-search-default-value', '');
if (!empty($_REQUEST['tribe-bar-date'])) {
$value = $_REQUEST['tribe-bar-date'];
}
$caption = __('Date', 'the-events-calendar');
if (tribe_is_month()) {
$caption = sprintf(__('%s In', 'the-events-calendar'), $this->plural_event_label);
} elseif (tribe_is_list_view()) {
$caption = sprintf(__('%s From', 'the-events-calendar'), $this->plural_event_label);
} elseif (tribe_is_day()) {
$caption = __('Day Of', 'the-events-calendar');
$value = date(Tribe__Events__Date_Utils::DBDATEFORMAT, strtotime($wp_query->query_vars['eventDate']));
}
$caption = apply_filters('tribe_bar_datepicker_caption', $caption);
$filters['tribe-bar-date'] = array('name' => 'tribe-bar-date', 'caption' => $caption, 'html' => '<input type="text" name="tribe-bar-date" style="position: relative;" id="tribe-bar-date" value="' . esc_attr($value) . '" placeholder="' . esc_attr__('Date', 'the-events-calendar') . '"><input type="hidden" name="tribe-bar-date-day" id="tribe-bar-date-day" class="tribe-no-param" value="">');
return $filters;
}
示例12:
</div>
<?php
}
?>
<h1>
<?php
if (tribe_is_month()) {
echo 'Events';
} else {
if (tribe_is_event() && !tribe_is_day() && !is_single()) {
echo 'Events';
} else {
if (is_singular('tribe_events')) {
echo 'Events';
} else {
if (tribe_is_day()) {
echo 'Events';
} else {
if (tribe_is_upcoming()) {
echo 'Events';
} else {
if (tribe_is_past()) {
echo 'Events';
} else {
echo roots_title();
}
}
}
}
}
}
示例13: tribe_is_list_view
/**
* Determines if we are in list view.
*
* @return bool
* @since 2.1
*/
function tribe_is_list_view()
{
if (tribe_is_event_query() && (tribe_is_upcoming() || tribe_is_past() || tribe_is_day() || is_single() && tribe_is_showing_all())) {
$return = true;
} else {
$return = false;
}
return apply_filters('tribe_is_list_view', $return);
}
示例14: get_current_template_class
/**
* Get the correct internal page template
*
* @return string Template class
*/
public static function get_current_template_class()
{
$class = '';
// list view
if (tribe_is_list_view() || tribe_is_showing_all()) {
$class = 'Tribe_Events_List_Template';
} else {
if (tribe_is_month()) {
$class = 'Tribe_Events_Month_Template';
} else {
if (tribe_is_day()) {
$class = 'Tribe_Events_Day_Template';
} else {
if (is_singular(TribeEvents::POSTTYPE)) {
$class = 'Tribe_Events_Single_Event_Template';
}
}
}
}
// apply filters
// @todo remove deprecated filter in 3.4
return apply_filters('tribe_events_current_template_class', apply_filters('tribe_current_events_template_class', $class));
}
示例15: event_classes
/**
* Add classes to events on this view
*
* @return array
* @author Jessica Yazbek
* @since 3.0
**/
public function event_classes($classes)
{
global $post, $wp_query;
$classes = array_merge($classes, array('hentry', 'vevent', 'type-tribe_events', 'post-' . $post->ID, 'tribe-clearfix'));
$tribe_cat_slugs = tribe_get_event_cat_slugs($post->ID);
foreach ($tribe_cat_slugs as $tribe_cat_slug) {
$classes[] = 'tribe-events-category-' . $tribe_cat_slug;
}
if ($venue_id = tribe_get_venue_id($post->ID)) {
$classes[] = 'tribe-events-venue-' . $venue_id;
}
if ($organizer_id = tribe_get_organizer_id($post->ID)) {
$classes[] = 'tribe-events-organizer-' . $organizer_id;
}
// added first class for css
if ($wp_query->current_post == 0 && !tribe_is_day()) {
$classes[] = 'tribe-events-first';
}
// added last class for css
if ($wp_query->current_post == $wp_query->post_count - 1) {
$classes[] = 'tribe-events-last';
}
return $classes;
}