本文整理汇总了PHP中tribe_is_upcoming函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_is_upcoming函数的具体用法?PHP tribe_is_upcoming怎么用?PHP tribe_is_upcoming使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_is_upcoming函数的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: tribe_get_previous_events_link
/**
* Get a link to the previous events
*
* @return string
*/
function tribe_get_previous_events_link()
{
$link = '';
if (tribe_is_upcoming() && (!empty($_REQUEST['tribe_paged']) && $_REQUEST['tribe_paged'] > 1)) {
// if we're more than one page into the future, the previous link will be in the future as well
$link = tribe_get_upcoming_link();
} else {
$link = tribe_get_past_link();
}
return apply_filters('tribe_get_previous_events_link', $link);
}
示例3: get_title
/**
* Get the title for list view
* @param $title
* @param null $sep
*
* @return string
*/
protected function get_title($original_title, $sep = null)
{
$new_title = parent::get_title($original_title, $sep);
if (tribe_is_upcoming() && has_filter('tribe_upcoming_events_title')) {
_deprecated_function("The 'tribe_upcoming_events_title' filter", '3.8', " the 'tribe_get_events_title' filter");
$new_title = apply_filters('tribe_upcoming_events_title', $new_title, $sep);
} elseif (has_filter('tribe_past_events_title')) {
_deprecated_function("The 'tribe_past_events_title' filter", '3.8', " the 'tribe_get_events_title' filter");
$new_title = apply_filters('tribe_past_events_title', $new_title, $sep);
}
return $new_title;
}
示例4: wpv_upcoming_events_title
function wpv_upcoming_events_title($title)
{
$upcoming = wpv_get_option('tribe-events-upcoming-title');
$past = wpv_get_option('tribe-events-past-title');
$month = wpv_get_option('tribe-events-month-title');
if (!empty($upcoming) && (tribe_is_upcoming() || function_exists('tribe_is_map') && tribe_is_map() || function_exists('tribe_is_photo') && tribe_is_photo())) {
return $upcoming;
} elseif (!empty($past) && tribe_is_past()) {
return $past;
} elseif (!empty($month) && tribe_is_month()) {
return sprintf($month, date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())));
}
return $title;
}
示例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: tribe_events_the_header_attributes
/**
* Prints out data attributes used in the template header tags
*
* @param string|null $current_view
* @return void
* @since 3.0
**/
function tribe_events_the_header_attributes($current_view = null)
{
$attrs = array();
$current_view = !empty($current_view) ? $current_view : basename(tribe_get_current_template());
$attrs['data-title'] = wp_title('»', false);
switch ($current_view) {
case 'month.php':
$attrs['data-view'] = 'month';
$attrs['data-date'] = date('Y-m', strtotime(tribe_get_month_view_date()));
$attrs['data-baseurl'] = tribe_get_gridview_link(false);
break;
case 'list.php':
$attrs['data-view'] = 'list';
if (tribe_is_upcoming()) {
$attrs['data-baseurl'] = tribe_get_listview_link(false);
} elseif (tribe_is_past()) {
$attrs['data-view'] = 'past';
$attrs['data-baseurl'] = tribe_get_listview_past_link(false);
}
break;
}
$attrs = apply_filters('tribe_events_header_attributes', $attrs, $current_view);
foreach ($attrs as $attr => $value) {
echo " {$attr}=" . '"' . $value . '"';
}
}
示例7: is_events_archive
function is_events_archive()
{
if (class_exists('Tribe__Events__Main')) {
return tribe_is_month() || tribe_is_day() || tribe_is_past() || tribe_is_upcoming() || class_exists('Tribe__Events__Pro__Main') && (tribe_is_week() || tribe_is_photo() || tribe_is_map()) ? true : false;
} else {
return false;
}
}
示例8: sp_is_upcoming
/**
* @deprecated
*/
function sp_is_upcoming()
{
_deprecated_function(__FUNCTION__, '2.0', 'tribe_is_upcoming()');
return tribe_is_upcoming();
}
示例9: elseif
?>
</span></a>
<?php
} elseif (tribe_is_past() && get_next_posts_link()) {
?>
<?php
next_posts_link('<span>' . __('« Previous Events', 'tribe-events-calendar') . '</span>');
?>
<?php
}
?>
</div>
<div class="tribe-events-nav-next"><?php
// Display Next Page Navigation
if (tribe_is_upcoming() && get_next_posts_link()) {
?>
<?php
next_posts_link('<span>' . __('Next Events »', 'tribe-events-calendar') . '</span>');
?>
<?php
} elseif (tribe_is_past() && get_previous_posts_link()) {
?>
<?php
previous_posts_link('<span>' . __('Next Events »', 'tribe-events-calendar') . '</span>');
// a little confusing but in 'past view' to see newer events you want the previous page
?>
<?php
} elseif (tribe_is_past() && !get_previous_posts_link()) {
?>
<a href='<?php
示例10: display_sidebar
/**
* Determine which pages should NOT display the sidebar
*/
function display_sidebar()
{
static $display;
isset($display) || ($display = !in_array(true, [is_404(), is_front_page(), is_page_template('template-custom.php'), is_page('about'), is_page('contact'), is_page('menu'), is_page('gallery'), is_page('thank-you'), is_single(), is_home(), 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_month() && is_tax(), tribe_is_event() && is_single()]));
return apply_filters('sage/display_sidebar', $display);
}
示例11: nothing_found_notice
/**
* Sets an appropriate no results found message. This may be overridden in child classes.
*/
protected function nothing_found_notice()
{
list($search_term, $tax_term, $geographic_term) = $this->get_search_terms();
if (!empty($search_term)) {
TribeEvents::setNotice('event-search-no-results', sprintf(__('There were no results found for <strong>"%s"</strong>.', 'tribe-events-calendar'), esc_html($search_term)));
} elseif (!empty($geographic_term)) {
TribeEvents::setNotice('event-search-no-results', sprintf(__('No results were found for events in or near <strong>"%s"</strong>.', 'tribe-events-calendar'), esc_html($geographic_term)));
} elseif (!empty($tax_term) && tribe_is_upcoming() && date('Y-m-d') === date('Y-m-d', strtotime($tribe->date))) {
TribeEvents::setNotice('events-not-found', sprintf(__('No upcoming events listed under %s. Check out upcoming events for this category or view the full calendar.', 'tribe-events-calendar'), $tax_term));
} elseif (!empty($tax_term) && tribe_is_upcoming()) {
TribeEvents::setNotice('events-not-found', sprintf(__('No matching events listed under %s. Please try viewing the full calendar for a complete list of events.', 'tribe-events-calendar'), $tax_term));
} elseif (!empty($tax_term) && tribe_is_past()) {
TribeEvents::setNotice('events-past-not-found', __('No previous events ', 'tribe-events-calendar'));
} elseif (!empty($tax_term)) {
TribeEvents::setNotice('events-not-found', sprintf(__('No matching events listed under %s. Please try viewing the full calendar for a complete list of events.', 'tribe-events-calendar'), $tax_term));
} else {
TribeEvents::setNotice('event-search-no-results', __('There were no results found.', 'tribe-events-calendar'));
}
}
示例12: 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));
}
}
示例13: is_events_archive
function is_events_archive()
{
if (class_exists('TribeEvents')) {
if (tribe_is_month() || tribe_is_day() || tribe_is_past() || tribe_is_upcoming()) {
return true;
} else {
return false;
}
} else {
return false;
}
}
示例14: nothing_found_notice
/**
* Sets an appropriate no results found message. This may be overridden in child classes.
*/
protected function nothing_found_notice()
{
$events_label_plural = strtolower(tribe_get_event_label_plural());
list($search_term, $tax_term, $geographic_term) = $this->get_search_terms();
$tribe = Tribe__Events__Main::instance();
if (!empty($search_term)) {
Tribe__Events__Main::setNotice('event-search-no-results', sprintf(__('There were no results found for <strong>"%s"</strong>.', 'the-events-calendar'), esc_html($search_term)));
} elseif (!empty($geographic_term)) {
Tribe__Events__Main::setNotice('event-search-no-results', sprintf(__('No results were found for %1$s in or near <strong>"%2$s"</strong>.', 'the-events-calendar'), $events_label_plural, esc_html($geographic_term)));
} elseif (!empty($tax_term) && tribe_is_upcoming() && date('Y-m-d') === date('Y-m-d', strtotime($tribe->date))) {
Tribe__Events__Main::setNotice('events-not-found', sprintf(__('No upcoming %1$s listed under %2$s. Check out upcoming %3$s for this category or view the full calendar.', 'the-events-calendar'), $events_label_plural, $tax_term, $events_label_plural));
} elseif (!empty($tax_term) && tribe_is_upcoming()) {
Tribe__Events__Main::setNotice('events-not-found', sprintf(__('No matching %1$s listed under %2$s. Please try viewing the full calendar for a complete list of %3$s.', 'the-events-calendar'), $events_label_plural, $tax_term, $events_label_plural));
} elseif (!empty($tax_term) && tribe_is_past()) {
Tribe__Events__Main::setNotice('events-past-not-found', sprintf(__('No previous %s ', 'the-events-calendar'), $events_label_plural));
} elseif (!empty($tax_term)) {
Tribe__Events__Main::setNotice('events-not-found', sprintf(__('No matching %1$s listed under %2$s. Please try viewing the full calendar for a complete list of %3$s.', 'the-events-calendar'), $events_label_plural, $tax_term, $events_label_plural));
} else {
Tribe__Events__Main::setNotice('event-search-no-results', __('There were no results found.', 'the-events-calendar'));
}
}
示例15: get_current_page_template
public static function get_current_page_template()
{
$template = '';
if (is_tax(TribeEvents::TAXONOMY)) {
if (tribe_is_upcoming() || tribe_is_past()) {
$template = TribeEventsTemplates::getTemplateHierarchy('list');
} else {
$template = TribeEventsTemplates::getTemplateHierarchy('gridview');
}
}
// single event
if (is_single() && !tribe_is_showing_all()) {
$template = TribeEventsTemplates::getTemplateHierarchy('single');
} elseif (tribe_is_upcoming() || tribe_is_past() || tribe_is_day() || is_single() && tribe_is_showing_all()) {
$template = TribeEventsTemplates::getTemplateHierarchy('list');
} else {
$template = TribeEventsTemplates::getTemplateHierarchy('gridview');
}
return apply_filters('tribe_current_events_page_template', $template);
}