本文整理汇总了PHP中tribe_get_date_format函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_get_date_format函数的具体用法?PHP tribe_get_date_format怎么用?PHP tribe_get_date_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_get_date_format函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tribe_format_date
/**
* Formatted Date
*
* Returns formatted date
*
* @category Events
* @param string $date String representing the datetime, assumed to be UTC (relevant if timezone conversion is used)
* @param bool $display_time If true shows date and time, if false only shows date
* @param string $date_format Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php)
*
* @return string
*/
function tribe_format_date($date, $display_time = true, $date_format = '')
{
if (!Tribe__Date_Utils::is_timestamp($date)) {
$date = strtotime($date);
}
if ($date_format) {
$format = $date_format;
} else {
$date_year = date('Y', $date);
$cur_year = date('Y', current_time('timestamp'));
// only show the year in the date if it's not in the current year
$with_year = $date_year == $cur_year ? false : true;
if ($display_time) {
$format = tribe_get_datetime_format($with_year);
} else {
$format = tribe_get_date_format($with_year);
}
}
$date = date_i18n($format, $date);
/**
* Deprecated tribe_event_formatted_date in 4.0 in favor of tribe_formatted_date. Remove in 5.0
*/
$date = apply_filters('tribe_event_formatted_date', $date, $display_time, $date_format);
return apply_filters('tribe_formatted_date', $date, $display_time, $date_format);
}
示例2: display_created_recurrences_notice
public function display_created_recurrences_notice()
{
$pending = get_post_meta(get_the_ID(), '_EventNextPendingRecurrence', true);
if (!$pending) {
return;
}
$start_dates = tribe_get_recurrence_start_dates(get_the_ID());
$count = count($start_dates);
$last = end($start_dates);
$pending_message = __('%d instances of this event have been created through %s. <a href="%s">Learn more.</a>', 'tribe-events-calendar-pro');
$pending_message = sprintf($pending_message, $count, date_i18n(tribe_get_date_format(true), strtotime($last)), 'http://m.tri.be/lq');
$this->notice->render($pending_message, 'updated');
}
示例3: event_details_top
/**
* Injects event meta data into the Attendees report
*
* @param int $event_id
*/
public function event_details_top($event_id)
{
$post_type = get_post_type($event_id);
if (Tribe__Events__Main::POSTTYPE === $post_type) {
echo '
<li>
<strong>' . esc_html__('Start Date:', 'the-events-calendar') . '</strong>
' . tribe_get_start_date($event_id, false, tribe_get_date_format(true)) . '
</li>
';
}
if (tribe_has_venue($event_id)) {
$venue_id = tribe_get_venue_id($event_id);
echo '
<li class="venue-name">
<strong>' . tribe_get_venue_label_singular() . ': </strong>
<a href="' . get_edit_post_link($venue_id) . '" title="' . esc_html__('Edit Venue', 'the-events-calendar') . '">' . tribe_get_venue($event_id) . '</a>
</li>
';
}
}
示例4: column_imported
public function column_imported($post)
{
$record = Tribe__Events__Aggregator__Records::instance()->get_by_post_id($post);
if ('scheduled' === $this->tab->get_slug()) {
$has_child_record = $record->get_child_record_by_status('success', 1);
if (!$has_child_record) {
return $this->render(esc_html__('On Demand', 'the-events-calendar'));
}
}
$last_import = null;
$original = $post->post_modified_gmt;
$time = strtotime($original);
$now = current_time('timestamp', true);
$html[] = '<span title="' . esc_attr($original) . '">';
if ($now - $time <= DAY_IN_SECONDS) {
$diff = human_time_diff($time, $now);
if ($now - $time > 0) {
$html[] = sprintf(esc_html_x('about %s ago', 'human readable time ago', 'the-events-calendar'), $diff);
} else {
$html[] = sprintf(esc_html_x('in about %s', 'in human readable time', 'the-events-calendar'), $diff);
}
} else {
$html[] = date(tribe_get_date_format(true), $time) . '<br>' . date(Tribe__Date_Utils::TIMEFORMAT, $time);
}
$html[] = '</span>';
return $this->render($html);
}
示例5: 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(esc_html__('Upcoming %s', 'the-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()) {
$first_returned_date = tribe_get_start_date($wp_query->posts[0], false, Tribe__Date_Utils::DBDATEFORMAT);
$first_event_date = tribe_get_start_date($wp_query->posts[0], false);
$last_event_date = tribe_get_end_date($wp_query->posts[count($wp_query->posts) - 1], false);
// If we are on page 1 then we may wish to use the *selected* start date in place of the
// first returned event date
if (1 == $wp_query->get('paged') && $_REQUEST['tribe-bar-date'] < $first_returned_date) {
$first_event_date = tribe_format_date($_REQUEST['tribe-bar-date'], false);
}
$title = sprintf(__('%1$s for %2$s - %3$s', 'the-events-calendar'), $events_label_plural, $first_event_date, $last_event_date);
} elseif (tribe_is_past()) {
$title = sprintf(esc_html__('Past %s', 'the-events-calendar'), $events_label_plural);
}
if (tribe_is_month()) {
$title = sprintf(esc_html__('%1$s for %2$s', 'the-events-calendar'), $events_label_plural, date_i18n(tribe_get_date_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())));
}
// day view title
if (tribe_is_day()) {
$title = sprintf(esc_html__('%1$s for %2$s', 'the-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);
}
示例6: nothing_found_notice
protected function nothing_found_notice()
{
list($search_term, $tax_term, $geographic_term) = $this->get_search_terms();
if (empty($search_term) && empty($geographic_term) && !empty($tax_term)) {
TribeEvents::setNotice('events-not-found', sprintf(__('No matching events listed under %s scheduled for <strong>%s</strong>. Please try another day.', 'tribe-events-calendar'), $tax_term, date_i18n(tribe_get_date_format(true), strtotime(get_query_var('eventDate')))));
} elseif (empty($search_term) && empty($geographic_term)) {
TribeEvents::setNotice('events-not-found', sprintf(__('No events scheduled for <strong>%s</strong>. Please try another day.', 'tribe-events-calendar'), date_i18n(tribe_get_date_format(true), strtotime(get_query_var('eventDate')))));
} else {
parent::nothing_found_notice();
}
}
示例7: tribe_events_event_schedule_details
/**
* Return the details of the start/end date/time.
*
* The highest level means of customizing this function's output is simply to adjust the date format settings under
* Events > Settings > Display, and WordPress time formats (via the General Settings admin screen).
* Beyond that, however, there are two filters which can be used to exercise further control here.
*
* The first is 'tribe_events_event_schedule_details_formatting' which allows an array of format settings to be
* altered - it's basic make-up is as a simple set of key:value pairs as follows.
*
* "show_end_time": for single day events only (not including all day events) it may not always be desirable to
* include the end time. In that situation, this setting can be set to false and the end time will not be
* displayed.
*
* "time": if it is undesirable to show times and only dates should be displayed then this setting can be set to
* false. If it is false it will by extension cause 'show_end_time' to be false.
*
* The resulting string can also be caught and manipulated, or completely overridden, using the
* 'tribe_events_event_schedule_details' filter, should none of the above settings be sufficient.
*
* @category Events
* @TODO use tribe_get_datetime_format() and related functions if possible
*
* @param int|null $event
* @param string $before
* @param string $after
*
* @return mixed|void
*/
function tribe_events_event_schedule_details($event = null, $before = '', $after = '')
{
if (is_null($event)) {
global $post;
$event = $post;
}
if (is_numeric($event)) {
$event = get_post($event);
}
$schedule = '<span class="date-start dtstart">';
$format = '';
$date_without_year_format = tribe_get_date_format();
$date_with_year_format = tribe_get_date_format(true);
$time_format = get_option('time_format');
$datetime_separator = tribe_get_option('dateTimeSeparator', ' @ ');
$time_range_separator = tribe_get_option('timeRangeSeparator', ' - ');
$microformatStartFormat = tribe_get_start_date($event, false, 'Y-m-dTh:i');
$microformatEndFormat = tribe_get_end_date($event, false, 'Y-m-dTh:i');
$settings = array('show_end_time' => true, 'time' => true);
$settings = wp_parse_args(apply_filters('tribe_events_event_schedule_details_formatting', $settings), $settings);
if (!$settings['time']) {
$settings['show_end_time'] = false;
}
extract($settings);
$format = $date_with_year_format;
// if it starts and ends in the current year then there is no need to display the year
if (tribe_get_start_date($event, false, 'Y') === date('Y') && tribe_get_end_date($event, false, 'Y') === date('Y')) {
$format = $date_without_year_format;
}
if (tribe_event_is_multiday($event)) {
// multi-date event
$format2ndday = apply_filters('tribe_format_second_date_in_range', $format, $event);
if (tribe_event_is_all_day($event)) {
$schedule .= tribe_get_start_date($event, true, $format);
$schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
$schedule .= '</span>' . $time_range_separator;
$schedule .= '<span class="date-end dtend">';
$schedule .= tribe_get_end_date($event, true, $format2ndday);
$schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
} else {
$schedule .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
$schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
$schedule .= '</span>' . $time_range_separator;
$schedule .= '<span class="date-end dtend">';
$schedule .= tribe_get_end_date($event, false, $format2ndday) . ($time ? $datetime_separator . tribe_get_end_date($event, false, $time_format) : '');
$schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
}
} elseif (tribe_event_is_all_day($event)) {
// all day event
$schedule .= tribe_get_start_date($event, true, $format);
$schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
} else {
// single day event
if (tribe_get_start_date($event, false, 'g:i A') === tribe_get_end_date($event, false, 'g:i A')) {
// Same start/end time
$schedule .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
$schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
} else {
// defined start/end time
$schedule .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
$schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
$schedule .= '</span>' . ($show_end_time ? $time_range_separator : '');
$schedule .= '<span class="end-time dtend">';
$schedule .= ($show_end_time ? tribe_get_end_date($event, false, $time_format) : '') . '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
}
}
$schedule .= '</span>';
$schedule = $before . $schedule . $after;
return apply_filters('tribe_events_event_schedule_details', $schedule, $event->ID);
}
示例8: tribe_events_template_data
/**
* Returns json for javascript templating functions throughout the plugin.
*
* @param $event
* @param $additional
*
* @return string
*/
function tribe_events_template_data($event, array $additional = null)
{
$has_image = false;
$start_time = '';
$end_time = '';
$image_src = '';
$image_tool_src = '';
// @TODO use tribe_events_event_schedule_details()
$date_format = tribe_get_date_format(true);
$time_format = get_option('time_format', TribeDateUtils::TIMEFORMAT);
$date_time_separator = tribe_get_option('dateTimeSeparator', ' @ ');
if (!empty($event->EventStartDate)) {
$start_time .= date_i18n($date_format, strtotime($event->EventStartDate));
}
if (!tribe_get_event_meta($event->ID, '_EventAllDay', true)) {
$start_time .= $date_time_separator . date_i18n($time_format, strtotime($event->EventStartDate));
}
if (!empty($event->EventEndDate) && $event->EventStartDate !== $event->EventEndDate) {
if (date('Y-m-d', strtotime($event->EventStartDate)) == date('Y-m-d', strtotime($event->EventEndDate))) {
if (!tribe_get_event_meta($event->ID, '_EventAllDay', true)) {
$end_time .= date_i18n($time_format, strtotime($event->EventEndDate));
}
} else {
$end_time .= date_i18n($date_format, strtotime($event->EventEndDate));
if (!tribe_get_event_meta($event->ID, '_EventAllDay', true)) {
$end_time .= $date_time_separator . date_i18n($time_format, strtotime($event->EventEndDate));
}
}
}
if (function_exists('has_post_thumbnail') && has_post_thumbnail($event->ID)) {
$has_image = true;
$image_arr = wp_get_attachment_image_src(get_post_thumbnail_id($event->ID), 'medium');
$image_src = $image_arr[0];
}
if ($has_image) {
$image_tool_arr = wp_get_attachment_image_src(get_post_thumbnail_id($event->ID), array(75, 75));
$image_tool_src = $image_tool_arr[0];
}
if (has_excerpt($event->ID)) {
$excerpt = $event->post_excerpt;
} else {
$excerpt = $event->post_content;
}
$excerpt = TribeEvents::instance()->truncate($excerpt, 30);
$category_classes = tribe_events_event_classes($event->ID, false);
$json = array('eventId' => $event->ID, 'title' => $event->post_title, 'permalink' => tribe_get_event_link($event->ID), 'imageSrc' => $image_src, 'startTime' => $start_time, 'endTime' => $end_time, 'imageTooltipSrc' => $image_tool_src, 'excerpt' => $excerpt, 'categoryClasses' => $category_classes);
if ($additional) {
$json = array_merge((array) $json, (array) $additional);
}
$json = apply_filters('tribe_events_template_data_array', $json, $event, $additional);
$json = tribe_prepare_for_json_deep($json);
return json_encode($json);
}
示例9: tribe_get_datetime_format
/**
* Get the Datetime Format
*
* @category Events
*
* @param bool $with_year
*
* @return mixed|void
*/
function tribe_get_datetime_format($with_year = false)
{
$separator = (array) str_split(tribe_get_option('dateTimeSeparator', ' @ '));
$format = tribe_get_date_format($with_year);
$format .= (!empty($separator) ? '\\' : '') . implode('\\', $separator);
$format .= get_option('time_format');
return apply_filters('tribe_datetime_format', $format);
}
示例10: 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);
}
示例11: maybeAddEventTitle
/**
* Add event title where appropriate
*
* @param string $title
* @param string|null $sep
* @return mixed|void
*/
public function maybeAddEventTitle($title, $sep = null)
{
switch (get_query_var('eventDisplay')) {
case 'upcoming':
$new_title = apply_filters('tribe_upcoming_events_title', __("Upcoming Events", 'tribe-events-calendar') . ' ' . $sep . ' ' . $title, $sep);
break;
case 'past':
$new_title = apply_filters('tribe_past_events_title', __("Past Events", 'tribe-events-calendar') . ' ' . $sep . ' ' . $title, $sep);
break;
case 'month':
if (get_query_var('eventDate')) {
$title_date = date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(get_query_var('eventDate')));
$new_title = apply_filters('tribe_month_grid_view_title', sprintf(__("Events for %s", 'tribe-events-calendar'), $title_date) . ' ' . $sep . ' ' . $title, $sep, $title_date);
} else {
$new_title = apply_filters('tribe_events_this_month_title', sprintf(__("Events this month", 'tribe-events-calendar'), get_query_var('eventDate')) . ' ' . $sep . ' ' . $title, $sep);
}
break;
case 'day':
$title_date = date_i18n(tribe_get_date_format(true), strtotime(get_query_var('eventDate')));
$new_title = apply_filters('tribe_events_day_view_title', sprintf(__("Events for %s", 'tribe-events-calendar'), $title_date) . ' ' . $sep . ' ', $sep, $title_date);
break;
default:
$new_title = $title;
break;
}
return apply_filters('tribe_events_add_title', $new_title, $title, $sep);
}
示例12: getBlogTitle
function getBlogTitle()
{
global $wp_query;
$page = getBlogType();
if (themerex_strpos($page, 'woocommerce') !== false) {
if ($page == 'woocommerce_category') {
$cat = get_term_by('slug', get_query_var('product_cat'), 'product_cat', ARRAY_A);
return $cat['name'];
} else {
if ($page == 'woocommerce_tag') {
return sprintf(__('Tag: %s', 'themerex'), single_tag_title('', false));
} else {
if ($page == 'woocommerce_cart') {
return __('Your cart', 'themerex');
} else {
if ($page == 'woocommerce_checkout') {
return __('Checkout', 'themerex');
} else {
if ($page == 'woocommerce_account') {
return __('Account', 'themerex');
} else {
if ($page == 'woocommerce_product') {
return getPostTitle();
} else {
if (($page_id = get_option('woocommerce_shop_page_id')) > 0) {
return getPostTitle($page_id);
}
//__( 'Shop', 'themerex' );
}
}
}
}
}
}
} else {
if (themerex_strpos($page, 'tribe') !== false) {
//return tribe_get_events_title();
if ($page == 'tribe_category') {
$cat = get_term_by('slug', get_query_var('tribe_events_cat'), 'tribe_events_cat', ARRAY_A);
return $cat['name'];
} else {
if ($page == 'tribe_tag') {
return sprintf(__('Tag: %s', 'themerex'), single_tag_title('', false));
} else {
if ($page == 'tribe_venue') {
return sprintf(__('Venue: %s', 'themerex'), tribe_get_venue());
} else {
if ($page == 'tribe_organizer') {
return sprintf(__('Organizer: %s', 'themerex'), tribe_get_organizer());
} else {
if ($page == 'tribe_day') {
return sprintf(__('Daily Events: %s', 'themerex'), date_i18n(tribe_get_date_format(true), strtotime($wp_query->get('start_date'))));
} else {
if ($page == 'tribe_month') {
return sprintf(__('Monthly Events: %s', 'themerex'), date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())));
} else {
if ($page == 'tribe_event') {
return getPostTitle();
} else {
return __('Tribe Events', 'themerex');
}
}
}
}
}
}
}
} else {
if ($page == 'blog') {
return __('All Posts', 'themerex');
} else {
if ($page == 'author') {
$curauth = get_query_var('author_name') ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
return sprintf(__('Author page: %s', 'themerex'), $curauth->display_name);
} else {
if ($page == 'error') {
return __('URL not found', 'themerex');
} else {
if ($page == 'search') {
return sprintf(__('Search Results for: %s', 'themerex'), get_search_query());
} else {
if ($page == 'archives_day') {
return sprintf(__('Daily Archives: %s', 'themerex'), prepareDateForTranslation(get_the_date()));
} else {
if ($page == 'archives_month') {
return sprintf(__('Monthly Archives: %s', 'themerex'), prepareDateForTranslation(get_the_date('F Y')));
} else {
if ($page == 'archives_year') {
return sprintf(__('Yearly Archives: %s', 'themerex'), get_the_date('Y'));
} else {
if ($page == 'category') {
return sprintf(__('%s', 'themerex'), single_cat_title('', false));
} else {
if ($page == 'tag') {
return sprintf(__('Tag: %s', 'themerex'), single_tag_title('', false));
} else {
if ($page == 'attachment') {
return sprintf(__('Attachment: %s', 'themerex'), getPostTitle());
} else {
if ($page == 'single') {
//.........这里部分代码省略.........
示例13: 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
*/
function tribe_get_events_title($depth = true)
{
global $wp_query;
$tribe_ecp = TribeEvents::instance();
$title = __('Upcoming Events', 'tribe-events-calendar');
// TODO: Use the displayed dates for the title
if (tribe_is_past()) {
$title = __('Past Events', 'tribe-events-calendar');
}
if (tribe_is_month()) {
$title = sprintf(__('Events for %s', 'tribe-events-calendar'), date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())));
}
// day view title
if (tribe_is_day()) {
$title = __('Events for', 'tribe-events-calendar') . ' ' . date_i18n(tribe_get_date_format(true), strtotime($wp_query->get('start_date')));
}
if (is_tax($tribe_ecp->get_event_taxonomy())) {
$cat = get_queried_object();
if ($depth) {
$title = '<a href="' . tribe_get_events_link() . '">' . $title . '</a>';
$title .= ' › ' . $cat->name;
} else {
$title = $cat->name;
}
}
return apply_filters('tribe_template_factory_debug', apply_filters('tribe_get_events_title', $title), 'tribe_get_events_title');
}
示例14: 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
* @since 2.0
*/
function tribe_get_events_title($depth = true)
{
global $wp_query;
$tribe_ecp = TribeEvents::instance();
$title = __('Upcoming Events', 'tribe-events-calendar');
// TODO: Use the displayed dates for the title
/*
if ( tribe_is_upcoming() || isset( $_REQUEST['tribe-bar-date'] ) ) {
$start_date = date( 'Y-m-d', strtotime( $wp_query->get( 'start_date' ) ) );
if ( $wp_query->get( 'start_date' ) && $start_date != date('Y-m-d') ) {
if ( get_query_var('paged') > 1 ) {
// get the date of the first post
$first_post = reset($wp_query->posts);
$start_date = date('Y-m-d', strtotime($first_post->EventStartDate));
}
$format = __('Events for %1$s', 'tribe-events-calendar');
$args = array(date_i18n( get_option( 'date_format', 'Y-m-d' ), strtotime($start_date) ));
// Get the date of the last post
if ( count($wp_query->posts) > 1 ) {
$last_post = end($wp_query->posts);
$last_post_date = date('Y-m-d', strtotime($last_post->EventStartDate));
if ( $last_post_date != $start_date ) {
$format = __('Events for %1$s through %2$s', 'tribe-events-calendar');
$args[] = date_i18n( get_option( 'date_format', 'Y-m-d' ), strtotime($last_post_date) );
}
}
$title = vsprintf($format, $args);
}
} else */
if (tribe_is_past()) {
$title = __('Past Events', 'tribe-events-calendar');
}
if (tribe_is_month()) {
$title = sprintf(__('Events for %s', 'tribe-events-calendar'), date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())));
}
// day view title
if (tribe_is_day()) {
$title = __('Events for', 'tribe-events-calendar') . ' ' . date_i18n(tribe_get_date_format(true), strtotime($wp_query->get('start_date')));
}
if (is_tax($tribe_ecp->get_event_taxonomy())) {
$cat = get_queried_object();
if ($depth) {
$title = '<a href="' . tribe_get_events_link() . '">' . $title . '</a>';
$title .= ' › ' . $cat->name;
} else {
$title = $cat->name;
}
}
return apply_filters('tribe_template_factory_debug', apply_filters('tribe_get_events_title', $title), 'tribe_get_events_title');
}
示例15: display_post_editor_recurring_notice
public static function display_post_editor_recurring_notice()
{
$message = __('You are currently editing all events in a recurring series.', 'tribe-events-calendar-pro');
printf('<div class="updated"><p>%s</p></div>', $message);
$pending = get_post_meta(get_the_ID(), '_EventNextPendingRecurrence', true);
if ($pending) {
$start_dates = tribe_get_recurrence_start_dates(get_the_ID());
$count = count($start_dates);
$last = end($start_dates);
$pending_message = __('%d instances of this event have been created through %s. <a href="%s">Learn more.</a>', 'tribe-events-calendar-pro');
$pending_message = sprintf($pending_message, $count, date_i18n(tribe_get_date_format(true), strtotime($last)), 'http://m.tri.be/lq');
printf('<div class="updated"><p>%s</p></div>', $pending_message);
}
}