本文整理汇总了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');
}
开发者ID:acutedeveloper,项目名称:havering-intranet-development,代码行数:13,代码来源:Admin_Notices.php
示例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);
}
开发者ID:TMBR,项目名称:johnjohn,代码行数:16,代码来源:general.php
示例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);
}
}
开发者ID:kevinaxu,项目名称:99boulders,代码行数:17,代码来源:Main.php
示例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);
}
开发者ID:jamestrevorlees,项目名称:odd-web-v1.00,代码行数:19,代码来源:Recurrence_Meta.php
示例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];
}
开发者ID:TakenCdosG,项目名称:chefs,代码行数:16,代码来源:Translations.php
示例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);
}
}
开发者ID:TMBR,项目名称:johnjohn,代码行数:14,代码来源:tribe-events-recurrence-meta.class.php
示例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);
}
开发者ID:donwea,项目名称:nhap.org,代码行数:6,代码来源:general.php
注:本文中的tribe_get_recurrence_start_dates函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论