本文整理汇总了PHP中tribe_is_showing_all函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_is_showing_all函数的具体用法?PHP tribe_is_showing_all怎么用?PHP tribe_is_showing_all使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_is_showing_all函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hooks
protected function hooks()
{
parent::hooks();
if (tribe_is_showing_all()) {
add_filter('tribe_get_template_part_path_modules/bar.php', '__return_false');
}
}
示例2: set_notices
/**
* Set up the notices for this template
*
**/
public function set_notices()
{
parent::set_notices();
$events_label_singular_lowercase = tribe_get_event_label_singular_lowercase();
if (!tribe_is_showing_all() && tribe_is_past_event()) {
Tribe__Notices::set_notice('event-past', sprintf(esc_html__('This %s has passed.', 'the-events-calendar'), $events_label_singular_lowercase));
}
}
示例3: set_notices
/**
* Set up the notices for this template
*
* @return void
* @since 3.0
**/
public function set_notices()
{
parent::set_notices();
// Check if event has passed
$gmt_offset = get_option('gmt_offset') >= '0' ? ' +' . get_option('gmt_offset') : " " . get_option('gmt_offset');
$gmt_offset = str_replace(array('.25', '.5', '.75'), array(':15', ':30', ':45'), $gmt_offset);
if (!tribe_is_showing_all() && strtotime(tribe_get_end_date(get_the_ID(), false, 'Y-m-d G:i') . $gmt_offset) <= time()) {
TribeEvents::setNotice('event-past', __('This event has passed.', 'tribe-events-calendar'));
}
}
示例4: set_notices
/**
* Set up the notices for this template
**/
public function set_notices()
{
parent::set_notices();
$events_label_singular_lowercase = tribe_get_event_label_singular_lowercase();
global $post;
// Check if event has passed
$gmt_offset = get_option('gmt_offset') >= '0' ? ' +' . get_option('gmt_offset') : ' ' . get_option('gmt_offset');
$gmt_offset = str_replace(array('.25', '.5', '.75'), array(':15', ':30', ':45'), $gmt_offset);
if (!tribe_is_showing_all() && strtotime(tribe_get_end_date($post, false, 'Y-m-d G:i') . $gmt_offset) <= time()) {
Tribe__Notices::set_notice('event-past', sprintf(esc_html__('This %s has passed.', 'the-events-calendar'), $events_label_singular_lowercase));
}
}
示例5: filter_wpml_ls_languages_event
public function filter_wpml_ls_languages_event($languages)
{
if (!tribe_is_showing_all()) {
return $languages;
}
foreach ($languages as $key => $language) {
$parts = explode('/', untrailingslashit($language['url']));
array_pop($parts);
$parts[] = 'all';
$language['url'] = trailingslashit(implode('/', $parts));
$languages[$key] = $language;
}
return $languages;
}
示例6: load_ecp_comments_page_template
public static function load_ecp_comments_page_template($template)
{
$tribe_ecp = TribeEvents::instance();
remove_filter('comments_template', array(__CLASS__, 'load_ecp_comments_page_template'));
if (!is_single() || tribe_is_showing_all() || tribe_get_option('showComments', false) === false) {
return $tribe_ecp->pluginPath . 'admin-views/no-comments.php';
}
return $template;
}
示例7: setReccuringEventDates
public function setReccuringEventDates($post)
{
if (function_exists('tribe_is_recurring_event') && is_singular(self::POSTTYPE) && tribe_is_recurring_event() && !tribe_is_showing_all() && !tribe_is_upcoming() && !tribe_is_past() && !tribe_is_month() && !tribe_is_by_date()) {
$startTime = get_post_meta($post->ID, '_EventStartDate', true);
$startTime = TribeDateUtils::timeOnly($startTime);
$post->EventStartDate = TribeDateUtils::addTimeToDate($this->date, $startTime);
$post->EventEndDate = date(TribeDateUtils::DBDATETIMEFORMAT, strtotime($post->EventStartDate) + get_post_meta($post->ID, '_EventDuration', true));
}
}
示例8: 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;
//.........这里部分代码省略.........
示例9: tribe_is_past
/**
* Past Loop View Test
*
* Returns true if the query is set for past events, false otherwise
*
* @return bool
*/
function tribe_is_past()
{
global $wp_query;
$is_past = !empty($wp_query->tribe_is_past) && !tribe_is_showing_all() ? $wp_query->tribe_is_past : false;
return apply_filters('tribe_is_past', $is_past);
}
示例10: oembed_discovery_links_for_recurring_events
/**
* Outputs oembed resource links on the /all/ pages for recurring events
*
* @since 4.2
*
* @param string $output Resource links to output
*
* @return string
*/
public function oembed_discovery_links_for_recurring_events($output)
{
global $wp_query;
if ($output) {
return $output;
}
if (!tribe_is_showing_all()) {
return $output;
}
if (empty($wp_query->posts[0])) {
return $output;
}
$post = $wp_query->posts[0];
$post_id = $post->ID;
$output = '<link rel="alternate" type="application/json+oembed" href="' . esc_url(get_oembed_endpoint_url(add_query_arg('post_id', $post_id, get_permalink($post_id)))) . '" />' . "\n";
if (class_exists('SimpleXMLElement')) {
$output .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url(get_oembed_endpoint_url(add_query_arg('post_id', $post_id, get_permalink($post_id)), 'xml')) . '" />' . "\n";
}
return $output;
}
示例11: body_class
/**
* Filter the body class
*
* @param array $classes
*
* @return void
**/
public function body_class($classes = array())
{
// view class
$classes[] = $this->body_class;
// category class
if (is_tax(Tribe__Events__Main::TAXONOMY)) {
$classes[] = 'events-category';
$category = get_term_by('name', single_cat_title('', false), Tribe__Events__Main::TAXONOMY);
$classes[] = 'events-category-' . $category->slug;
}
// archive class
if (!is_single() || tribe_is_showing_all()) {
$single_id = array_search('single-tribe_events', $classes);
if (!empty($single_id)) {
$classes[$single_id] = 'events-list';
}
$classes[] = 'events-archive';
}
// add selected style to body class for add-on styling
$style_option = tribe_get_option('stylesheetOption', 'tribe');
switch ($style_option) {
case 'skeleton':
$classes[] = 'tribe-events-style-skeleton';
// Skeleton styles
break;
case 'full':
$classes[] = 'tribe-events-style-full';
// Full styles
break;
default:
// tribe styles is the default so add full and theme (tribe)
$classes[] = 'tribe-events-style-full';
$classes[] = 'tribe-events-style-theme';
break;
}
return $classes;
}
示例12: displaySidebar
/**
* Display the filters sidebar.
*
* @author PaulHughes01
* @since 3.4
* @return void
*/
public function displaySidebar($html)
{
if ($this->sidebarDisplayed) {
if (!is_single() || tribe_is_showing_all()) {
ob_start();
tribe_get_template_part('filter-bar/filter-view-' . tribe_get_option('events_filters_layout', 'vertical'));
$html = ob_get_clean() . $html;
}
echo $html;
}
}
示例13: fitclub_tribe_alter_event_archive_titles
function fitclub_tribe_alter_event_archive_titles($depth)
{
// Modify the titles here
// Some of these include %1$s and %2$s, these will be replaced with relevant dates
$title_upcoming = esc_html__('Upcoming Events', 'fitclub');
// List View: Upcoming events
$title_past = esc_html__('Past Events', 'fitclub');
// List view: Past events
$title_range = esc_html__('Events for %1$s - %2$s', 'fitclub');
// List view: range of dates being viewed
$title_month = esc_html__('Events for %1$s', 'fitclub');
// Month View, %1$s = the name of the month
$title_day = esc_html__('Events for %1$s', 'fitclub');
// Day View, %1$s = the day
$title_all = esc_html__('All events for %s', 'fitclub');
// showing all recurrences of an event, %s = event title
$title_week = esc_html__('Events for week of %s', 'fitclub');
// Week view
// Don't modify anything below this unless you know what it does
global $wp_query;
$tribe_ecp = Tribe__Events__Main::instance();
$date_format = apply_filters('tribe_events_pro_page_title_date_format', tribe_get_date_format(true));
// Default Title
$title = $title_upcoming;
// 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_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($title_range, $first_event_date, $last_event_date);
} elseif (tribe_is_past()) {
$title = $title_past;
}
// Month view title
if (tribe_is_month()) {
$title = sprintf($title_month, date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())));
}
// Single view title
if (tribe_is_event() && is_single()) {
$title = get_the_title();
}
// Day view title
if (tribe_is_day()) {
$title = sprintf($title_day, date_i18n(tribe_get_date_format(true), strtotime($wp_query->get('start_date'))));
}
// All recurrences of an event
if (function_exists('tribe_is_showing_all') && tribe_is_showing_all()) {
$title = sprintf($title_all, get_the_title());
}
// Week view title
if (function_exists('tribe_is_week') && tribe_is_week()) {
$title = sprintf($title_week, date_i18n($date_format, strtotime(tribe_get_first_week_day($wp_query->get('start_date')))));
}
if (is_tax($tribe_ecp->get_event_taxonomy()) && $depth) {
$cat = get_queried_object();
$title = $cat->name;
}
return $title;
}
示例14: miss_get_breadcrumbs
//.........这里部分代码省略.........
$html .= miss_breadcrumbs_bold(__('Archives for ', MISS_TEXTDOMAIN) . single_month_title(' ', false), $args['bold']);
} elseif (is_year()) {
$html .= miss_breadcrumbs_bold(__('Archives for ', MISS_TEXTDOMAIN) . get_the_time('Y'), $args['bold']);
}
} elseif (is_author()) {
$html .= miss_breadcrumbs_bold(__('Archives by: ', MISS_TEXTDOMAIN) . get_the_author_meta('display_name', $wp_query->post->post_author), $args['bold']);
}
} elseif (miss_is_bp()) {
global $bp;
// we're outside the loop!
//print_r( $bp );
if (isset($bp) && is_object($bp) && isset($bp->current_component)) {
// Assign some variables here
$homeurl = get_bloginfo('url');
$bp_page1 = $bp->members->root_slug;
// bp_get_members_root_slug() // slug for the Members page. The BuddyPress default is 'members'.
$bp_page2 = $bp->groups->root_slug;
// bp_get_groups_root_slug() // slug for the Groups page. The BuddyPress default is 'groups'.
$bp_page3 = $bp->activity->root_slug;
// bp_get_activity_root_slug() // slug for the Activity page. The BuddyPress default is 'activity'.
$bp_page4 = $bp->forums->root_slug;
// bp_get_forums_root_slug() // slug for the Forums page. The BuddyPress default is 'forums'.
//$bp_page5 = $bp->achievements->root_slug; // slug for the Achievements page. The BuddyPress default is 'achievements'.
if (bp_is_group()) {
$html .= $home . $separator . __('Groups', MISS_TEXTDOMAIN);
if (is_404()) {
$html .= $separator . miss_breadcrumbs_bold(__('Not Found', MISS_TEXTDOMAIN), $args['bold']);
}
}
if (bp_is_user() && !bp_is_register_page()) {
$html .= $home . " {$separator} " . '<a href="' . $homeurl . '/' . $bp_page1 . '/">' . ucwords($bp_page1) . '</a>' . " {$separator} " . '<a href="' . $bp->displayed_user->domain . '">' . ucwords($bp->displayed_user->fullname) . '</a>' . " {$divider} " . ucwords($bp->current_component) . "";
}
if (!bp_is_blog_page() && (is_page() || is_page($bp_page1) || is_page($bp_page2) || is_page($bp_page3) || is_page($bp_page4)) && !bp_is_user() && !bp_is_single_item() && !bp_is_register_page()) {
$html .= $home . " {$separator} " . get_the_title() . "";
}
if (bp_is_register_page()) {
$html .= $home . " {$separator} " . get_the_title() . "";
}
if (bp_is_blog_page() && is_home() && $front == "page") {
$html .= "<a href='" . $homeurl . "'>{$home}</a>" . " {$separator} " . $blog . "";
}
if (get_query_var('paged')) {
if (bp_is_blog_page() && !(is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author())) {
$html .= ' (Page' . ' ' . get_query_var('paged') . ')';
}
}
/* $html .= $home . $separator . miss_breadcrumbs_bold( __( 'Search results for "', MISS_TEXTDOMAIN ) . stripslashes( strip_tags( get_search_query() ) ) . '"', $args['bold'] ); */
}
} elseif (is_search()) {
$html .= $home . $separator . miss_breadcrumbs_bold(__('Search results for "', MISS_TEXTDOMAIN) . stripslashes(strip_tags(get_search_query())) . '"', $args['bold']);
} elseif (is_404()) {
$html .= $home . $separator . miss_breadcrumbs_bold(__('Page Not Found', MISS_TEXTDOMAIN), $args['bold']);
} else {
$html = '';
}
if (class_exists('TribeEventsPro')) {
if (class_exists('TribeEvents')) {
$tec = TribeEvents::instance();
$events_page = '<a href="' . home_url('/') . trailingslashit($tec->getOption('eventsSlug', 'events')) . '" title="' . __('Events', MISS_TEXTDOMAIN) . '">' . __('Events', MISS_TEXTDOMAIN) . '</a>';
$html_event = $home . $separator . $events_page;
}
if (function_exists('tribe_is_month') && tribe_is_month()) {
$html = $html_event;
$html .= $separator . __('Events for', MISS_TEXTDOMAIN) . ' ' . Date("F Y", strtotime($wp_query->get('start_date')));
}
if (function_exists('tribe_is_day') && tribe_is_day()) {
$html = $html_event;
$html .= $separator . __('Events for', MISS_TEXTDOMAIN) . ' ' . 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')) {
$html = $html_event;
$html .= $separator . sprintf(__('Events for week of %s', MISS_TEXTDOMAIN), Date("l, F jS Y", strtotime(tribe_get_first_week_day($wp_query->get('start_date')))));
}
}
if (function_exists('tribe_is_map') && tribe_is_map() || function_exists('tribe_is_photo') && tribe_is_photo()) {
if (tribe_is_past()) {
$html = $html_event;
$html .= $separator . __('Past Events', MISS_TEXTDOMAIN);
} else {
$html = $html_event;
$html .= $separator . __('Upcoming Events', MISS_TEXTDOMAIN);
}
}
if (function_exists('tribe_is_showing_all') && tribe_is_showing_all()) {
$html = $html_event;
$html .= $separator . sprintf('%s %s', __('All events for', MISS_TEXTDOMAIN), get_the_title());
}
}
//$breadcrumbs = '<div class="breadcrumb breadcrumbs"><div class="breadcrumbs-plus">';
$breadcrumbs = $args['prefix'];
$breadcrumbs .= $html;
$breadcrumbs .= $args['suffix'];
//$breadcrumbs .= '</div></div>';
$breadcrumbs = apply_filters('miss_get_breadcrumbs', $breadcrumbs);
if (!$args['echo']) {
return $breadcrumbs;
}
echo $breadcrumbs;
}
示例15: body_class
/**
* Filter the body class
*
* @param array $classes
* @return void
* @since 3.0
**/
public function body_class($classes = array())
{
// view class
$classes[] = $this->body_class;
// category class
if (is_tax(TribeEvents::TAXONOMY)) {
$classes[] = 'events-category';
$category = get_term_by('name', single_cat_title('', false), TribeEvents::TAXONOMY);
$classes[] = 'events-category-' . $category->slug;
}
// archive class
if (!is_single() || tribe_is_showing_all()) {
$single_id = array_search('single-tribe_events', $classes);
if (!empty($single_id)) {
$classes[$single_id] = 'events-list';
}
$classes[] = 'events-archive';
}
return $classes;
}