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

PHP tribe_is_recurring_event函数代码示例

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

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



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

示例1: custom_recurrence_description

 /**
  * Responsible for displaying a user's custom recurrence pattern description.
  *
  * @deprecated since 3.6
  * @param string $meta_id The meta group this is in.
  * @return string The custom description.
  * @author Timothy Wood
  * @since 3.0
  */
 public static function custom_recurrence_description($meta_id)
 {
     global $_tribe_meta_factory;
     $post_id = get_the_ID();
     $recurrence_meta = TribeEventsRecurrenceMeta::getRecurrenceMeta($post_id);
     $recurrence_description = !empty($recurrence_meta['recCustomRecurrenceDescription']) ? $recurrence_meta['recCustomRecurrenceDescription'] : tribe_get_recurrence_text($post_id);
     $html = tribe_is_recurring_event($post_id) ? Tribe_Meta_Factory::template($_tribe_meta_factory->meta[$meta_id]['label'], $recurrence_description, $meta_id) : '';
     return apply_filters('tribe_event_pro_meta_custom_recurrence_description', $html);
 }
开发者ID:pellio11,项目名称:ns-select-project,代码行数:18,代码来源:SingleEventMeta.php


示例2: should_filter_permalink

 protected function should_filter_permalink($post, $sample)
 {
     if ($post->post_type != TribeEvents::POSTTYPE) {
         return false;
     }
     if (!tribe_is_recurring_event($post->ID)) {
         return false;
     }
     $unpublished = isset($post->post_status) && in_array($post->post_status, array('draft', 'pending', 'auto-draft'));
     if ($unpublished && !$sample) {
         return false;
     }
     return true;
 }
开发者ID:TMBR,项目名称:johnjohn,代码行数:14,代码来源:tribeeventspro-recurrencepermalinks.php


示例3: addDateToEventPermalink

 public static function addDateToEventPermalink($permalink, $the_post)
 {
     global $post;
     $event = $the_post ? $the_post : $post;
     if (tribe_is_recurring_event($post->ID)) {
         $events = TribeEvents::instance();
         if ('' == get_option('permalink_structure') || false == $events->getOption('useRewriteRules', true)) {
             return esc_url(add_query_arg('eventDate', TribeDateUtils::dateOnly($event->EventStartDate), get_permalink($event->ID)));
         } else {
             return $permalink . TribeDateUtils::dateOnly($event->EventStartDate);
         }
     } else {
         return $permalink;
     }
 }
开发者ID:mpaskew,项目名称:isc-dev,代码行数:15,代码来源:tribe-events-recurrence-meta.class.php


示例4: get_output

 public function get_output($event_ID, $complete, $show_seconds, $event_date = null)
 {
     $ret = $complete;
     ob_start();
     include Tribe__Events__Templates::getTemplateHierarchy('pro/widgets/countdown-widget');
     $hourformat = ob_get_clean();
     // Get the event start date.
     $startdate = tribe_is_recurring_event($event_ID) ? $event_date . ' ' . tribe_get_start_date($event_ID, false, Tribe__Events__Date_Utils::DBTIMEFORMAT) : tribe_get_start_date($event_ID, false, Tribe__Events__Date_Utils::DBDATETIMEFORMAT);
     // Get the number of seconds remaining until the date in question.
     $seconds = strtotime($startdate) - current_time('timestamp');
     if ($seconds > 0) {
         $ret = $this->generate_countdown_output($seconds, $complete, $hourformat, $event_ID, $event_date);
     }
     return $ret;
 }
开发者ID:simple-beck,项目名称:project-gc,代码行数:15,代码来源:Countdown_Widget.php


示例5: print_all_events_link

    public static function print_all_events_link()
    {
        if (tribe_is_recurring_event()) {
            ?>
			<p class="tribe-events-back tribe-events-loop">
				<a href="<?php 
            echo esc_url(tribe_get_events_link());
            ?>
"> <?php 
            printf('&laquo; ' . esc_html__('All %s', 'the-events-calendar'), tribe_get_event_label_plural());
            ?>
</a>
			</p>
			<?php 
        }
    }
开发者ID:TakenCdosG,项目名称:chefs,代码行数:16,代码来源:List_View.php


示例6: tribe_get_recurrence_ical_link

 /**
  * Returns the link to export the whole recurring  series in iCal format.
  *
  * @param int|WP_Pos|null $event_id A event post object, an event post ID or null to use the globally defined post object.
  *
  * @return string The absolute URL to export the whole recurring series in iCal format.
  */
 function tribe_get_recurrence_ical_link($event_id = null)
 {
     $event_id = Tribe__Events__Main::postIdHelper($event_id);
     if (empty($event_id) || !tribe_is_event($event_id)) {
         return '';
     }
     $event = get_post($event_id);
     $parent_id = empty($event->post_parent) ? $event_id : $event->post_parent;
     $url = get_permalink($parent_id);
     $url_vars = array('ical' => '1');
     if (tribe_is_recurring_event($parent_id)) {
         $child_events_ids = tribe_get_events(array('fields' => 'ids', 'post_parent' => $parent_id));
         $event_ids = array_merge(array($parent_id), $child_events_ids);
         $url_vars['event_ids'] = implode(',', $event_ids);
     }
     $url = add_query_arg($url_vars, $url);
     return apply_filters('tribe_get_recurrence_ical_link', $url, $event_id);
 }
开发者ID:acutedeveloper,项目名称:havering-intranet-development,代码行数:25,代码来源:ical.php


示例7: tribe_get_end_date

 /**
  * End Date
  *
  * Returns the event end date
  *
  * @param int $postId (optional) this only works for non recurring events
  * @param bool $displayTime If true shows date and time, if false only shows date
  * @param string $dateFormat Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php)
  * @return string Date
  * @todo support $postId for recurring events.
  * @since 2.0
  */
 function tribe_get_end_date($postId = null, $displayTime = 'true', $dateFormat = '')
 {
     $postId = TribeEvents::postIdHelper($postId);
     if (!$postId || function_exists('tribe_is_recurring_event') && tribe_is_recurring_event($postId)) {
         global $post;
     } else {
         $post = get_post($postId);
     }
     if (tribe_get_all_day($postId)) {
         $displayTime = false;
     }
     if (empty($post->EventEndDate)) {
         $post->EventEndDate = tribe_get_event_meta($postId, '_EventEndDate', true);
     }
     if (isset($post->EventEndDate)) {
         $date = strtotime($post->EventEndDate);
     } else {
         return;
         // '&mdash;';
     }
     return tribe_event_format_date($date, $displayTime, $dateFormat);
 }
开发者ID:mpaskew,项目名称:isc-dev,代码行数:34,代码来源:date.php


示例8: maybe_render_multiple_formatted_times

 /**
  * Alters the provided formatted time to include all recurrence times for the day
  *
  * @since 4.0.3
  *
  * @param string $formatted_time Formatted time range for the given event
  * @param int $event_id Event ID
  *
  * @return string
  */
 public function maybe_render_multiple_formatted_times($formatted_time, $event_id)
 {
     if (!tribe_is_recurring_event($event_id)) {
         return $formatted_time;
     }
     $date = tribe_get_start_date($event_id, false, Tribe__Date_Utils::DBDATEFORMAT);
     $time_format = get_option('time_format', Tribe__Date_Utils::TIMEFORMAT);
     $time_range_separator = tribe_get_option('timeRangeSeparator', ' - ');
     $events = $this->get_recurring_events_for_date($event_id, $date);
     $formatted_time = null;
     foreach ($events as $child) {
         $start_time = tribe_get_start_date($child->ID, false, $time_format);
         $end_time = tribe_get_end_date($child->ID, false, $time_format);
         $formatted_time .= '<div class="tribe-recurring-event-time">';
         if ($start_time === $end_time) {
             $formatted_time .= esc_html($start_time);
         } else {
             $formatted_time .= esc_html($start_time . $time_range_separator . $end_time);
         }
         $formatted_time .= '</div>';
     }
     return $formatted_time;
 }
开发者ID:acutedeveloper,项目名称:havering-intranet-development,代码行数:33,代码来源:Single_Event_Overrides.php


示例9: add_duplicate_action

 public function add_duplicate_action($actions, $post)
 {
     // Not a post? Bail (we aren't using a typehint since some plugins may pass in something a stdClass object etc)
     if (!is_a($post, 'WP_Post')) {
         return $actions;
     }
     // Not an event? Don't add the link
     if (Tribe__Events__Main::POSTTYPE !== $post->post_type) {
         return $actions;
     }
     // Recurring event? Don't add the link either!
     if (function_exists('tribe_is_recurring_event') && tribe_is_recurring_event($post->ID)) {
         return $actions;
     }
     // Form the link
     $url = $this->duplication_link_url($post->ID);
     $text = __('Duplicate', 'event-rocket');
     $date = tribe_get_start_date($post->ID, false, 'Y-m-d\\TH:i:s');
     $title = $this->get_duplicate_post_title($post);
     $link = '<a href="' . $url . '" class="eventrocket_duplicate" ' . 'data-date="' . $date . '" ' . 'data-title="' . $title . '" ' . '>' . $text . '</a>';
     // Add to the list of actions
     $actions['duplicate'] = $link;
     return $actions;
 }
开发者ID:michael-pratt,项目名称:event-rocket,代码行数:24,代码来源:event-duplicator.php


示例10: is_valid_record

 /**
  * @param array $record
  *
  * @return bool
  */
 public function is_valid_record(array $record)
 {
     $valid = parent::is_valid_record($record);
     if (empty($valid)) {
         return false;
     }
     $event = $this->get_event_from($record);
     if (empty($event)) {
         return false;
     }
     if (function_exists('tribe_is_recurring_event')) {
         $is_recurring = tribe_is_recurring_event($event->ID);
         if ($is_recurring) {
             $this->row_message = sprintf(esc_html__('Recurring event tickets are not supported, event %d.', 'event-tickets'), $event->post_title);
         }
         return !$is_recurring;
     }
     $this->row_message = false;
     return true;
 }
开发者ID:nullify005,项目名称:shcc-website,代码行数:25,代码来源:RSVP_Importer.php


示例11: array

<?php

/**
 * @var array $events
 */
$columns = array(_x('ID', 'csv-data', 'eventrocket'), _x('Title', 'csv-data', 'eventrocket'), _x('Description', 'csv-data', 'eventrocket'), _x('Start Date', 'csv-data', 'eventrocket'), _x('Start Time', 'csv-data', 'eventrocket'), _x('End Date', 'csv-data', 'eventrocket'), _x('End Time', 'csv-data', 'eventrocket'), _x('Venue', 'csv-data', 'eventrocket'), _x('Organizer', 'csv-data', 'eventrocket'), _x('All Day', 'csv-data', 'eventrocket'), _x('Recurring', 'csv-data', 'eventrocket'));
echo join(', ', $columns) . "\n";
foreach ($events as $event) {
    $fields = array(absint($event->ID), get_the_title($event), $event->post_content, tribe_get_start_date($event->ID, false, 'Y-m-d'), tribe_get_start_date($event->ID, false, 'H:i:s'), tribe_get_end_date($event->ID, false, 'Y-m-d'), tribe_get_end_date($event->ID, false, 'H:i:s'), tribe_get_venue($event->ID), tribe_get_organizer($event->ID), tribe_event_is_all_day($event->ID) ? '1' : '0', tribe_is_recurring_event($event->ID) ? '1' : '0');
    foreach ($fields as &$csv_field) {
        $csv_field = '"' . str_replace('"', '""', $csv_field) . '"';
    }
    echo join(', ', $fields) . "\n";
}
开发者ID:simple-beck,项目名称:project-gc,代码行数:14,代码来源:data-csv.php


示例12: add_event_occurrance_to_edit_link

 /**
  * Add the date to the edit link for recurring events.
  *
  * @param string $link The current link.
  * @param int $eventId The event id.
  * @return string The modified link.
  */
 public static function add_event_occurrance_to_edit_link($link, $eventId)
 {
     if (get_query_var('post_type') != TribeEvents::POSTTYPE) {
         return $link;
     }
     // if is a recurring event
     if (function_exists('tribe_is_recurring_event') && tribe_is_recurring_event($eventId) && isset(self::$events_list[0])) {
         $link = add_query_arg('eventDate', urlencode(TribeDateUtils::dateOnly(self::$events_list[0]->EventStartDate)), $link);
     }
     return $link;
 }
开发者ID:scttrgd,项目名称:scottish-piping,代码行数:18,代码来源:tribe-admin-events-list.class.php


示例13: _e

</a></dd>
		<?php 
}
?>

		<dt class="event-label event-label-updated"><?php 
_e('Updated:', 'tribe-events-calendar');
?>
</dt>
		<dd class="event-meta event-meta-updated"><span class="date updated"><?php 
the_date();
?>
</span></dd>
		
		<?php 
if (class_exists('TribeEventsRecurrenceMeta') && function_exists('tribe_get_recurrence_text') && tribe_is_recurring_event()) {
    ?>
			<dt class="event-label event-label-schedule"><?php 
    _e('Schedule:', 'tribe-events-calendar');
    ?>
</dt>
         <dd class="event-meta event-meta-schedule"><?php 
    echo tribe_get_recurrence_text();
    ?>
            <?php 
    if (class_exists('TribeEventsRecurrenceMeta') && function_exists('tribe_all_occurences_link')) {
        ?>
(<a href='<?php 
        tribe_all_occurences_link();
        ?>
'>See all</a>)<?php 
开发者ID:xdividr,项目名称:wi,代码行数:31,代码来源:single.php


示例14: doEventForm

 /**
  * Event editing form.
  *
  * @param int $id the event's ID.
  * @return string The editing view markup.
  * @author Nick Ciske
  * @since 1.0
  */
 public function doEventForm($id = null)
 {
     if (class_exists('TribeEventsPro')) {
         // venue and organizer defaults- override ECP defaults
         add_filter('tribe_get_single_option', array($this, 'filter_default_venue_id'), 10, 3);
         add_filter('tribe_get_single_option', array($this, 'filter_default_organizer_id'), 10, 3);
     }
     add_filter('tribe-post-origin', array($this, 'filterPostOrigin'));
     $output = '';
     $show_form = true;
     $event = null;
     if ($id) {
         $edit = true;
         $tribe_event_id = $id;
     } else {
         $edit = false;
         $tribe_event_id = null;
     }
     if ($tribe_event_id && class_exists('TribeEventsPro') && tribe_is_recurring_event($tribe_event_id)) {
         $this->enqueueOutputMessage(sprintf(__('%sWarning:%s You are editing a recurring event. All changes will be applied to the entire series.', 'tribe-events-community'), '<b>', '</b>'), 'error');
     }
     // Delete the featured image, if there was a request to do so.
     if (isset($_GET['action']) && $_GET['action'] == 'deleteFeaturedImage' && wp_verify_nonce($_GET['_wpnonce'], 'tribe_community_events_featured_image_delete') && current_user_can('edit_post', $tribe_event_id)) {
         $featured_image_id = get_post_thumbnail_id($tribe_event_id);
         delete_post_meta($tribe_event_id, '_thumbnail_id');
         wp_delete_attachment($featured_image_id, true);
     }
     if ($edit && $tribe_event_id) {
         $event = get_post(intval($tribe_event_id));
         global $post;
         $old_post = $post;
         $post = $event;
     }
     if ($edit && (!$tribe_event_id || !isset($event->ID))) {
         $this->enqueueOutputMessage(__('Event not found.', 'tribe-events-community'), 'error');
         $output = $this->outputMessage(null, false);
         $show_form = false;
     }
     // login check
     if (!$this->allowAnonymousSubmissions && !is_user_logged_in() || $edit && $tribe_event_id && !is_user_logged_in()) {
         do_action('tribe_ce_event_submission_login_form');
         $output .= $this->login_form(__('Please log in first.', 'tribe-events-community'));
         return $output;
     }
     // security check
     if ($edit && $tribe_event_id && !current_user_can('edit_post', $tribe_event_id)) {
         $output .= '<p>' . __('You do not have permission to edit this event.', 'tribe-events-community') . '</p>';
         return $output;
     }
     $this->loadScripts = true;
     do_action('tribe_ce_before_event_submission_page');
     $output .= '<div id="tribe-community-events" class="form">';
     if ($this->allowAnonymousSubmissions || is_user_logged_in()) {
         $current_user = wp_get_current_user();
         if (class_exists('TribeEventsPro')) {
             $tribe_ecp = TribeEventsPro::instance();
         }
         $submission = $this->get_submitted_event();
         if (!empty($submission)) {
             // show no sympathy for spammers
             if (!is_user_logged_in()) {
                 $this->spam_check($submission);
             }
             $submission['ID'] = $tribe_event_id;
             require_once 'tribe-community-events-submission-scrubber.php';
             $scrubber = new TribeCommunityEvents_SubmissionScrubber($submission);
             $_POST = $scrubber->scrub();
             // update the event
             if ($tribe_event_id && $this->validate_submission_has_required_fields($_POST)) {
                 if ($this->saveEvent($tribe_event_id)) {
                     $this->enqueueOutputMessage(__('Event updated.', 'tribe-events-community') . $this->get_view_edit_links($tribe_event_id));
                     $this->enqueueOutputMessage('<a href="' . $this->getUrl('add') . '">' . __('Submit another event', 'tribe-events-community') . '</a>');
                     delete_transient('tribe_community_events_today_page');
                     //clear cache
                 } else {
                     $this->enqueueOutputMessage($this->get_error_message($_POST, $tribe_event_id), 'error');
                 }
             } else {
                 // or create a new one
                 $_POST['post_status'] = $this->defaultStatus;
                 if ($this->validate_submission_has_required_fields($_POST)) {
                     $tribe_event_id = $this->createEvent();
                 }
                 if ($tribe_event_id) {
                     $this->enqueueOutputMessage(__('Event submitted.', 'tribe-events-community') . $this->get_view_edit_links($tribe_event_id));
                     $this->enqueueOutputMessage('<a href="' . $this->getUrl('add') . '">' . __('Submit another event', 'tribe-events-community') . '</a>');
                     // email alerts
                     if ($this->emailAlertsEnabled) {
                         $this->sendEmailAlerts($tribe_event_id);
                     }
                 } else {
                     $this->enqueueOutputMessage($this->get_error_message($_POST, $tribe_event_id), 'error');
//.........这里部分代码省略.........
开发者ID:donwea,项目名称:nhap.org,代码行数:101,代码来源:tribe-community-events.class.php


示例15: tribe_events_recurrence_tooltip

 /**
  * show the recurring event info in a tooltip
  *
  * return the details of the start/end date/time
  *
  * @since  3.5
  * @param int     $post_id
  * @return string
  */
 function tribe_events_recurrence_tooltip($post_id = null)
 {
     if (empty($post_id)) {
         $post_id = get_the_ID();
     }
     $tooltip = '';
     if (tribe_is_recurring_event($post_id)) {
         $tooltip .= '<div class="recurringinfo">';
         $tooltip .= '<div class="event-is-recurring">';
         $tooltip .= '<span class="tribe-events-divider">|</span>';
         $tooltip .= __('Recurring Event', 'tribe-events-calendar');
         $tooltip .= sprintf(' <a href="%s">%s</a>', tribe_all_occurences_link($post_id, false), __('(See all)', 'tribe-events-calendar'));
         $tooltip .= '<div id="tribe-events-tooltip-' . $post_id . '" class="tribe-events-tooltip recurring-info-tooltip">';
         $tooltip .= '<div class="tribe-events-event-body">';
         $tooltip .= tribe_get_recurrence_text($post_id);
         $tooltip .= '</div>';
         $tooltip .= '<span class="tribe-events-arrow"></span>';
         $tooltip .= '</div>';
         $tooltip .= '</div>';
         $tooltip .= '</div>';
     }
     $tooltip = apply_filters('tribe_events_event_recurring_info_tooltip', $tooltip);
     // for backwards-compat, will be removed
     return apply_filters('tribe_events_recurrence_tooltip', $tooltip);
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:34,代码来源:general.php


示例16: strtotime

            }
        }
        ?>
						</td>

						<td><?php 
        echo TribeEventsAdminList::custom_columns('events-cats', $post->ID, false);
        ?>
</td>

						<?php 
        if (function_exists('tribe_is_recurring_event')) {
            ?>
							<td>
							<?php 
            if (tribe_is_recurring_event($post->ID)) {
                _e('Yes', 'tribe-events-community');
            } else {
                _e('No', 'tribe-events-community');
            }
            ?>
							</td>
						<?php 
        }
        ?>

						<td>
						<?php 
        $start_date = strtotime($post->EventStartDate);
        echo tribe_event_format_date($start_date, false, TribeCommunityEvents::instance()->eventListDateFormat);
        ?>
开发者ID:WestBayResidential,项目名称:wbrsorg,代码行数:31,代码来源:event-list.php


示例17: detect_recurrence_redirect

 /**
  * At the pre_get_post hook detect if we should redirect to a particular instance
  * for an invalid 404 recurrence entries.
  *
  * @return void
  */
 public function detect_recurrence_redirect()
 {
     global $wp_query, $wp;
     if (!isset($wp_query->query_vars['eventDisplay'])) {
         return false;
     }
     $current_url = null;
     switch ($wp_query->query_vars['eventDisplay']) {
         case 'single-event':
             // a recurrence event with a bad date will throw 404 because of WP_Query limiting by date range
             if (is_404() || empty($wp_query->query['eventDate'])) {
                 $recurrence_check = array_merge(array('posts_per_page' => -1), $wp_query->query);
                 unset($recurrence_check['eventDate']);
                 unset($recurrence_check['tribe_events']);
                 // retrieve event object
                 $get_recurrence_event = new WP_Query($recurrence_check);
                 // if a reccurence event actually exists then proceed with redirection
                 if (!empty($get_recurrence_event->posts) && tribe_is_recurring_event($get_recurrence_event->posts[0]->ID) && get_post_status($get_recurrence_event->posts[0]) == 'publish') {
                     $current_url = Tribe__Events__Main::instance()->getLink('all', $get_recurrence_event->posts[0]->ID);
                 }
                 break;
             }
             // A child event should be using its parent's slug. If it's using its own, redirect.
             if (tribe_is_recurring_event(get_the_ID()) && '' !== get_option('permalink_structure')) {
                 $event = get_post(get_the_ID());
                 if (!empty($event->post_parent)) {
                     if (isset($wp_query->query['name']) && $wp_query->query['name'] == $event->post_name) {
                         $current_url = get_permalink($event->ID);
                     }
                 }
             }
             break;
     }
     if (!empty($current_url)) {
         // redirect user with 301
         $confirm_redirect = apply_filters('tribe_events_pro_detect_recurrence_redirect', true, $wp_query->query_vars['eventDisplay']);
         do_action('tribe_events_pro_detect_recurrence_redirect', $wp_query->query_vars['eventDisplay']);
         if ($confirm_redirect) {
             wp_safe_redirect($current_url, 301);
             exit;
         }
     }
 }
开发者ID:TravisSperry,项目名称:mpa_website,代码行数:49,代码来源:Main.php


示例18: addDeleteDialogForRecurringEvents

 /**
  * Adds the dialog box for when you try to delete a specific instance of a recurring event.
  *
  * @return void
  */
 public function addDeleteDialogForRecurringEvents()
 {
     global $current_screen, $post;
     if (is_admin() && isset($current_screen->post_type) && $current_screen->post_type == TribeEvents::POSTTYPE && (isset($current_screen->id) && $current_screen->id == 'edit-' . TribeEvents::POSTTYPE || isset($post->ID) && tribe_is_recurring_event($post->ID))) {
         // load the dialog
         require_once TribeEvents::instance()->pluginPath . 'admin-views/recurrence-dialog.php';
     }
 }
开发者ID:TyRichards,项目名称:river_of_life,代码行数:13,代码来源:events-calendar-pro.php


示例19: filter_sample_permalink

 /**
  * Filters the sample permalink to show a link to the first instance of recurring events.
  *
  * This is to match the real link pointing to a recurring events series first instance.
  *
  * @param string  $permalink Sample permalink.
  * @param int     $post_id   Post ID.
  *
  * @return string The permalink to the first recurring event instance if the the event
  *                is a recurring one, the original permalink otherwise.
  */
 public function filter_sample_permalink($permalink, $post_id)
 {
     if (!empty($post_id) && tribe_is_recurring_event($post_id)) {
         // fetch the real post permalink, recurring event filters down the road will
         // append the date to it
         $permalink = get_post_permalink($post_id);
     }
     return $permalink;
 }
开发者ID:TakenCdosG,项目名称:chefs,代码行数:20,代码来源:Permalinks.php


示例20: load_post_by_slug

 /**
  * We override the parent load_post_by_slug() method in order to better support recurring
  * events.
  *
  * It appears to an end user that a recurring event has a slug like "my-event", as they
  * have URLs in the form "example.com/events/my-event/(date)". However, the true slug/post
  * name is actually more like "my-event-yyyy-mm-dd".
  *
  * This causes a bit of a disconnect which this method tries to solve.
  *
  * @param  $slug
  * @param  $post_type
  * @return array
  */
 protected function load_post_by_slug($slug, $post_type)
 {
     $event = parent::load_post_by_slug($slug, $post_type);
     // If PRO is not activated/there are no recurrence facilities, let's do nothing more
     if (!function_exists('tribe_is_recurring_event')) {
         return $event;
     }
     // If this specific event is not in fact recurring in nature, let's do nothing more
     if (!tribe_is_recurring_event($event->ID)) {
         return $event;
     }
     // Add to list of recurring events before returning parent ID
     $rec_id = $event->post_parent ? $event->post_parent : $event->ID;
     $this->recurring_events[] = $rec_id;
     return $event;
 }
开发者ID:michael-pratt,项目名称:event-rocket,代码行数:30,代码来源:lister-events.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP tribe_is_showing_all函数代码示例发布时间:2022-05-23
下一篇:
PHP tribe_is_past函数代码示例发布时间: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