本文整理汇总了PHP中tribe_get_recurrence_start_dates函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_get_recurrence_start_dates函数的具体用法?PHP tribe_get_recurrence_start_dates怎么用?PHP tribe_get_recurrence_start_dates使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_get_recurrence_start_dates函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: tribe_is_recurring_event
function tribe_is_recurring_event($postId = null)
{
if (is_object($postId)) {
$postId = $postId->ID;
}
$postId = $postId ? $postId : get_the_ID();
if (get_post_type($postId) != TribeEvents::POSTTYPE) {
return false;
}
$instances = tribe_get_recurrence_start_dates($postId);
$recurring = count($instances) > 1;
if (!$recurring && get_post_meta($postId, '_EventNextPendingRecurrence', true)) {
$recurring = true;
}
return apply_filters('tribe_is_recurring_event', $recurring, $postId);
}
示例3: get_series_start_date
/**
* An event can have one or more start dates. This gives
* the earliest of those.
*
* @param int $post_id
*
* @return string The date string for the earliest occurrence of the event
*/
public static function get_series_start_date($post_id)
{
if (function_exists('tribe_get_recurrence_start_dates')) {
$start_dates = tribe_get_recurrence_start_dates($post_id);
return reset($start_dates);
} else {
return get_post_meta($post_id, '_EventStartDate', true);
}
}
示例4: get_series_start_date
/**
* Placed here for compatibility reasons. This can be removed
* when Events Calendar 3.2 or greater is released
*
* @todo Remove this method
*
* @param int $post_id
*
* @return string
* @see Tribe__Events__Main::get_series_start_date()
*/
private static function get_series_start_date($post_id)
{
if (method_exists('Tribe__Events__Main', 'get_series_start_date')) {
return Tribe__Events__Main::get_series_start_date($post_id);
}
$start_dates = tribe_get_recurrence_start_dates($post_id);
return reset($start_dates);
}
示例5: get_master_series_ids_and_start_dates
/**
* @param int $master_parent_event_id
*/
private function get_master_series_ids_and_start_dates($master_parent_event_id)
{
if (empty($this->master_series_ids_and_start_dates_cache[$master_parent_event_id])) {
$master_series_recurrence_dates = implode("','", tribe_get_recurrence_start_dates($master_parent_event_id));
/** @var \wpdb $wpdb */
global $wpdb;
$wpml_translations_table = $wpdb->prefix . 'icl_translations';
$post_type = Tribe__Events__Main::POSTTYPE;
$results = $wpdb->get_results("SELECT p.ID AS 'event_id', pm.meta_value AS 'start_date', wpml.trid as 'trid'\n\t\t\t\t\tFROM {$wpdb->posts} p\n\t\t\t\t\tLEFT JOIN {$wpdb->postmeta} pm \n\t\t\t\t\tON p.ID = pm.post_id \n\t\t\t\t\tLEFT JOIN {$wpml_translations_table} wpml \n\t\t\t\t\tON wpml.element_id = p.ID\n\t\t\t\t\tWHERE pm.meta_key = '_EventStartDate' \n\t\t\t\t\tAND pm.meta_value IN ('{$master_series_recurrence_dates}')\n\t\t\t\t\tAND wpml.element_type = 'post_{$post_type}'\n\t\t\t\t\tAND wpml.element_id IN (SELECT ID FROM {$wpdb->posts} WHERE ID = {$master_parent_event_id} OR post_parent = {$master_parent_event_id}) \n\t\t\t\t\tAND wpml.trid IS NOT NULL\n\t\t\t\t\tAND p.post_type = '{$post_type}'");
$this->master_series_ids_and_start_dates_cache[$master_parent_event_id] = !empty($results) ? array_combine(wp_list_pluck($results, 'start_date'), $results) : array();
}
return $this->master_series_ids_and_start_dates_cache[$master_parent_event_id];
}
示例6: 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);
}
}
示例7: tribe_is_recurring_event
function tribe_is_recurring_event($postId = null)
{
$instances = tribe_get_recurrence_start_dates($postId);
$recurring = count($instances) > 1;
return apply_filters('tribe_is_recurring_event', $recurring, $postId);
}