• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP tribe_event_is_multiday函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中tribe_event_is_multiday函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_event_is_multiday函数的具体用法?PHP tribe_event_is_multiday怎么用?PHP tribe_event_is_multiday使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了tribe_event_is_multiday函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: event_date

 /**
  * Get the event date
  *
  * @param int $meta_id
  * @return string
  */
 public static function event_date($meta_id)
 {
     $time_format = get_option('time_format', TribeDateUtils::TIMEFORMAT);
     $start_time = tribe_get_start_date(null, false, $time_format);
     $end_time = tribe_get_end_date(null, false, $time_format);
     if (tribe_event_is_all_day()) {
         if (tribe_event_is_multiday()) {
             $html = Tribe_Meta_Factory::template(__('Start:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr updated published dtstart" title="%s">%s</abbr>', tribe_get_start_date(null, false, TribeDateUtils::DBDATEFORMAT), tribe_get_start_date()), $meta_id);
             $html .= Tribe_Meta_Factory::template(__('End:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr dtend" title="%s">%s</abbr>', tribe_get_end_date(null, false, TribeDateUtils::DBDATEFORMAT), tribe_get_end_date()), $meta_id);
         } else {
             // If all day event, show only start date
             $html = Tribe_Meta_Factory::template(__('Date:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr updated published dtstart" title="%s">%s</abbr>', tribe_get_start_date(null, false, TribeDateUtils::DBDATEFORMAT), tribe_get_start_date()), $meta_id);
         }
     } elseif (tribe_event_is_multiday()) {
         // If multiday, show start date+time and end date+time
         $html = Tribe_Meta_Factory::template(__('Start:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr updated published dtstart" title="%s">%s</abbr>', tribe_get_start_date(null, false, TribeDateUtils::DBDATEFORMAT), tribe_get_start_date()), $meta_id);
         $html .= Tribe_Meta_Factory::template(__('End:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr dtend" title="%s">%s</abbr>', tribe_get_end_date(null, false, TribeDateUtils::DBDATEFORMAT), tribe_get_end_date()), $meta_id);
     } else {
         // show start date
         $html = Tribe_Meta_Factory::template(__('Date:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr updated published dtstart" title="%s">%s</abbr>', tribe_get_start_date(null, false, TribeDateUtils::DBDATEFORMAT), tribe_get_start_date(null, false)), $meta_id);
         if ($start_time == $end_time) {
             // if start and end time are the same, just show the start time
             $html .= Tribe_Meta_Factory::template(__('Time:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr dtend" title="%s">%s</abbr>', tribe_get_end_date(null, false, TribeDateUtils::DBDATEFORMAT), $start_time), $meta_id);
         } else {
             // show start and end time
             $html .= Tribe_Meta_Factory::template(__('Time:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr dtend" title="%s">%s</abbr>', tribe_get_end_date(null, false, TribeDateUtils::DBDATEFORMAT), $start_time . ' - ' . $end_time), $meta_id);
         }
     }
     return apply_filters('tribe_event_meta_event_date', $html);
 }
开发者ID:jvcanote,项目名称:wp-the-events-calendar,代码行数:36,代码来源:meta.php


示例2: esc_attr_e

 </dt>
			<dd>
				<abbr class="tribe-events-abbr updated published dtstart" title="<?php 
    esc_attr_e($start_ts);
    ?>
"> <?php 
    esc_html_e($start_date);
    ?>
 </abbr>
			</dd>



		<?php 
    // Multiday events
} elseif (tribe_event_is_multiday()) {
    ?>

			<dt> <?php 
    esc_html_e('Start:', 'the-events-calendar');
    ?>
 </dt>
			<dd>
				<abbr class="tribe-events-abbr updated published dtstart" title="<?php 
    esc_attr_e($start_ts);
    ?>
"> <?php 
    esc_html_e($start_datetime);
    ?>
 </abbr>
			</dd>
开发者ID:mattholsen,项目名称:caseylab,代码行数:31,代码来源:details.php


示例3: tribe_get_display_end_date

 /**
  * End Date formatted for display
  *
  * Returns the event end date that observes the end of day cutoff
  *
  * @category Events
  * @param int    $event        (optional)
  * @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)
  * @param string $timezone     Timezone in which to present the date/time (or default behaviour if not set)
  *
  * @return string|null Date
  */
 function tribe_get_display_end_date($event = null, $display_time = true, $date_format = '', $timezone = null)
 {
     $end_date = tribe_get_end_date($event, true, 'U', $timezone);
     $beginning_of_day = tribe_beginning_of_day(date(Tribe__Date_Utils::DBDATETIMEFORMAT, $end_date));
     if (tribe_event_is_multiday($event) && $end_date < strtotime($beginning_of_day)) {
         $end_date -= DAY_IN_SECONDS;
     }
     return tribe_format_date($end_date, $display_time, $date_format);
 }
开发者ID:duongnguyen92,项目名称:tvd12v2,代码行数:22,代码来源:date.php


示例4: 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);
 }
开发者ID:TMBR,项目名称:johnjohn,代码行数:99,代码来源:general.php


示例5: 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);
     }
     $inner = '<span class="tribe-event-date-start">';
     $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', ' - ');
     $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;
     }
     /**
      * @var $show_end_time
      * @var $time
      */
     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)) {
             $inner .= tribe_get_start_date($event, true, $format);
             $inner .= '</span>' . $time_range_separator;
             $inner .= '<span class="tribe-event-date-end">';
             $inner .= tribe_get_end_date($event, true, $format2ndday);
         } else {
             $inner .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
             $inner .= '</span>' . $time_range_separator;
             $inner .= '<span class="tribe-event-date-end">';
             $inner .= tribe_get_end_date($event, false, $format2ndday) . ($time ? $datetime_separator . tribe_get_end_date($event, false, $time_format) : '');
         }
     } elseif (tribe_event_is_all_day($event)) {
         // all day event
         $inner .= tribe_get_start_date($event, true, $format);
     } 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
             $inner .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
         } else {
             // defined start/end time
             $inner .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
             $inner .= '</span>' . ($show_end_time ? $time_range_separator : '');
             $inner .= '<span class="tribe-event-time">';
             $inner .= $show_end_time ? tribe_get_end_date($event, false, $time_format) : '';
         }
     }
     $inner .= '</span>';
     /**
      * Provides an opportunity to modify the *inner* schedule details HTML (ie before it is
      * wrapped).
      *
      * @param string $inner_html  the output HTML
      * @param int    $event_id    post ID of the event we are interested in
      */
     $inner = apply_filters('tribe_events_event_schedule_details_inner', $inner, $event->ID);
     // Wrap the schedule text
//.........这里部分代码省略.........
开发者ID:reubenbrown13,项目名称:the-events-calendar,代码行数:101,代码来源:general.php


示例6: tribe_events_event_schedule_details

 /**
  * Return the details of the start/end date/time
  *
  * @since 3.0
  * @param int|null $event
  * @return string
  */
 function tribe_events_event_schedule_details($event = null)
 {
     if (is_null($event)) {
         global $post;
         $event = $post;
     }
     if (is_numeric($event)) {
         $event = get_post($event);
     }
     $format = '';
     $timeFormat = get_option('time_format');
     $microformatStartFormat = tribe_get_start_date($event, false, 'Y-m-dTh:i');
     $microformatEndFormat = tribe_get_end_date($event, false, 'Y-m-dTh:i');
     // If the WordPress date setting matches DATEONLYFORMAT, make the string more readable
     if (get_option('date_format') == TribeDateUtils::DATEONLYFORMAT) {
         /* If the event happens this year, no need to show the year, unless it ends on another year (multi-day) */
         if (tribe_get_start_date($event, false, 'Y') === date('Y') && tribe_get_end_date($event, false, 'Y') === date('Y')) {
             $format = 'F j';
         }
     }
     $schedule = '';
     if (tribe_event_is_multiday($event)) {
         // multi-date event
         $format2ndday = $format;
         // If the WordPress date setting matches DATEONLYFORMAT, make the string more readable
         if (get_option('date_format') == TribeDateUtils::DATEONLYFORMAT) {
             //If it's all day and the end date is in the same month and year, just show the day.
             if (tribe_event_is_all_day($event) && tribe_get_end_date($event, false, 'm') === tribe_get_start_date($event, false, 'm') && tribe_get_end_date($event, false, 'Y') === date('Y')) {
                 $format2ndday = 'j';
             }
         }
         if (tribe_event_is_all_day($event)) {
             // If the multi-day event begins and ends in the same month, just show the month once.
             if (tribe_get_end_date($event, false, 'm') === tribe_get_start_date($event, false, 'm') && tribe_get_end_date($event, false, 'Y') === date('Y')) {
                 $schedule .= '<span class="date-start dtstart">';
                 $schedule .= tribe_get_start_date($event, true, $format);
                 $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
                 $schedule .= '</span> - ';
                 $schedule .= '<span class="date-end dtend">';
                 $schedule .= tribe_get_end_date($event, true, $format2ndday);
                 $schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
                 $schedule .= '</span>';
             } else {
                 $schedule .= '<span class="date-start dtstart">';
                 $schedule .= tribe_get_start_date($event, true, $format);
                 $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
                 $schedule .= '</span> - ';
                 $schedule .= '<span class="date-end dtend">';
                 $schedule .= tribe_get_end_date($event, true, $format2ndday);
                 $schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
                 $schedule .= '</span>';
             }
         } else {
             $schedule .= '<span class="date-start dtstart">';
             $schedule .= tribe_get_start_date($event, false, $format) . ' @ ' . tribe_get_start_date($event, false, $timeFormat);
             $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
             $schedule .= '</span> - ';
             $schedule .= '<span class="date-end dtend">';
             $schedule .= tribe_get_end_date($event, false, $format2ndday) . ' @ ' . tribe_get_end_date($event, false, $timeFormat);
             $schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
             $schedule .= '</span>';
         }
     } elseif (tribe_event_is_all_day($event)) {
         // all day event
         $schedule .= '<span class="date-start dtstart">';
         $schedule .= tribe_get_start_date($event, true, $format);
         $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
         $schedule .= '</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 .= '<span class="date-start dtstart">';
             $schedule .= tribe_get_start_date($event, false, $format) . ' @ ' . tribe_get_start_date($event, false, $timeFormat);
             $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
             $schedule .= '</span>';
         } else {
             // defined start/end time
             $schedule .= '<span class="date-start dtstart">';
             $schedule .= tribe_get_start_date($event, false, $format) . ' @ ' . tribe_get_start_date($event, false, $timeFormat);
             $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
             $schedule .= '</span> - ';
             $schedule .= '<span class="end-time dtend">';
             $schedule .= tribe_get_end_date($event, false, $timeFormat) . '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
             $schedule .= '</span>';
         }
     }
     return apply_filters('tribe_events_event_schedule_details', $schedule);
 }
开发者ID:paarthd,项目名称:gslvpa,代码行数:96,代码来源:general.php


示例7: tribe_is_multiday

 /**
  * @deprecated
  */
 function tribe_is_multiday($postId = null)
 {
     _deprecated_function(__FUNCTION__, '3.0', 'tribe_event_is_multiday( $postId )');
     return apply_filters('tribe_is_multiday', tribe_event_is_multiday($postId));
 }
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:8,代码来源:deprecated.php


示例8: tribe_events_get_widget_event_post_date

/**
 * Returns the event date, or today's date if the event has started and is not over yet.
 *
 * @return int
 **/
function tribe_events_get_widget_event_post_date()
{
    global $post, $wp_query;
    if (class_exists('Tribe__Events__Timezones')) {
        $startDate = Tribe__Events__Timezones::event_start_timestamp($post->ID, null);
        $endDate = Tribe__Events__Timezones::event_end_timestamp($post->ID, null);
    } else {
        $startDate = strtotime($post->EventStartDate);
        $endDate = strtotime($post->EventEndDate);
    }
    $is_multiday = tribe_event_is_multiday($post->ID);
    $is_all_day = tribe_event_is_all_day($post->ID);
    $today = current_time('timestamp');
    $yesterday = $today - DAY_IN_SECONDS;
    // Gets Yesterday cutoff to check which date we pick
    $yesterday_end = tribe_end_of_day(date(Tribe__Date_Utils::DBDATETIMEFORMAT, $yesterday), 'U') + 1;
    // Check if the yesterday cutoff will get the start date of the event
    if ($yesterday_end >= $startDate && !$is_multiday && !$is_all_day) {
        $postDate = $yesterday;
        // If the event starts way in the past or ends way in the future, let's show today's date
    } elseif ($today > $startDate && $today < $endDate) {
        $postDate = $today;
    } else {
        $postDate = $startDate;
    }
    /* If the user clicked in a particular day, let's show that day as the event date, even if the event spans a few days */
    if (defined('DOING_AJAX') && DOING_AJAX && isset($_POST['action']) && $_POST['action'] == 'tribe-mini-cal-day') {
        $postDate = strtotime($_POST['eventDate']);
    }
    return apply_filters('tribe_events_get_widget_event_post_date', $postDate);
}
开发者ID:jamestrevorlees,项目名称:odd-web-v1.00,代码行数:36,代码来源:widgets.php


示例9: 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 WordPress date and 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.
  *
  * "datetime_separator": this is inserted between the date and the time and defaults to an ampersat @ character.
  *     Note that if you modify this you should ordinarily be careful to include leading and trailing spaces (an
  *     example might be ' at ').
  *
  * "same_year_format": if an event starts and ends in the same year it's assumed that including the year in the
  *     output is superfluous. That being the case the function changes the date format, by default, to 'F j'. This
  *     may not be ideal in all locales so an alternative can be provided here. Do note that this substitution is
  *     only ever made if A) the event starts and ends in the same year and B) the date format does not include any
  *     time formatting characters.
  *
  *     This can also effectively be used to turn off the assumption that the year should be omitted, simply by
  *     setting it to the value of the 'date_format' option, for example.
  *
  * "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.
  *
  * @since 3.0
  * @param int|null $event
  * @return string
  */
 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 = '';
     $format = '';
     $date_format = get_option('date_format');
     $time_format = get_option('time_format');
     $microformatStartFormat = tribe_get_start_date($event, false, 'Y-m-dTh:i');
     $microformatEndFormat = tribe_get_end_date($event, false, 'Y-m-dTh:i');
     $settings = array('datetime_separator' => ' @ ', 'same_year_format' => 'F j', '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);
     // If the date format will result in the year being shown but does *not* include any time formatting...
     if (TribeDateUtils::formatContainsYear($date_format) && !TribeDateUtils::formatContainsTime($date_format)) {
         // ... and 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 = $same_year_format;
         }
     }
     if (tribe_event_is_multiday($event)) {
         // multi-date event
         $format2ndday = $format;
         // If the WordPress date setting matches DATEONLYFORMAT, make the string more readable
         if (get_option('date_format') == TribeDateUtils::DATEONLYFORMAT) {
             //If it's all day and the end date is in the same month and year, just show the day.
             if (tribe_event_is_all_day($event) && tribe_get_end_date($event, false, 'm') === tribe_get_start_date($event, false, 'm') && tribe_get_end_date($event, false, 'Y') === date('Y')) {
                 $format2ndday = 'j';
             }
         }
         if (tribe_event_is_all_day($event)) {
             // If the multi-day event begins and ends in the same month, just show the month once.
             if (tribe_get_end_date($event, false, 'm') === tribe_get_start_date($event, false, 'm') && tribe_get_end_date($event, false, 'Y') === date('Y')) {
                 $schedule .= '<span class="date-start dtstart">';
                 $schedule .= tribe_get_start_date($event, true, $format);
                 $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
                 $schedule .= '</span> - ';
                 $schedule .= '<span class="date-end dtend">';
                 $schedule .= tribe_get_end_date($event, true, $format2ndday);
                 $schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
                 $schedule .= '</span>';
             } else {
                 $schedule .= '<span class="date-start dtstart">';
                 $schedule .= tribe_get_start_date($event, true, $format);
                 $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
                 $schedule .= '</span> - ';
                 $schedule .= '<span class="date-end dtend">';
                 $schedule .= tribe_get_end_date($event, true, $format2ndday);
                 $schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
                 $schedule .= '</span>';
             }
         } else {
             $schedule .= '<span class="date-start dtstart">';
             $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>';
//.........这里部分代码省略.........
开发者ID:donwea,项目名称:nhap.org,代码行数:101,代码来源:general.php



注:本文中的tribe_event_is_multiday函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP tribe_events_after_html函数代码示例发布时间:2022-05-23
下一篇:
PHP tribe_event_is_all_day函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap