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

PHP tribe_events_latest_date函数代码示例

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

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



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

示例1: tribe_the_day_link

 /**
  * Output an html link to a day
  *
  * @category Events
  * @param string $date 'previous day', 'next day', 'yesterday', 'tomorrow', or any date string that strtotime() can parse
  * @param string $text text for the link
  *
  **/
 function tribe_the_day_link($date = null, $text = null)
 {
     $html = '';
     try {
         if (is_null($text)) {
             $text = tribe_get_the_day_link_label($date);
         }
         $date = tribe_get_the_day_link_date($date);
         $link = tribe_get_day_link($date);
         $earliest = tribe_events_earliest_date(Tribe__Date_Utils::DBDATEFORMAT);
         $latest = tribe_events_latest_date(Tribe__Date_Utils::DBDATEFORMAT);
         if ($date >= $earliest && $date <= $latest) {
             $html = '<a href="' . esc_url($link) . '" data-day="' . $date . '" rel="prev">' . $text . '</a>';
         }
     } catch (OverflowException $e) {
     }
     echo apply_filters('tribe_the_day_link', $html);
 }
开发者ID:duongnguyen92,项目名称:tvd12v2,代码行数:26,代码来源:day.php


示例2: update_known_range

 /**
  * Intelligently updates our record of the earliest start date/latest event date in
  * the system. If the existing earliest/latest values have not been superseded by the new post's
  * start/end date then no update takes place.
  *
  * This is deliberately hooked into save_post, rather than save_post_tribe_events, to avoid issues
  * where the removal/restoration of hooks within addEventMeta() etc might stop this method from
  * actually being called (relates to a core WP bug).
  *
  * @param int $event_id
  */
 public function update_known_range($event_id)
 {
     $is_earliest_date_marker = in_array($event_id, tribe_get_option('earliest_date_markers', array()));
     $is_latest_date_marker = in_array($event_id, tribe_get_option('latest_date_markers', array()));
     if ($is_earliest_date_marker || $is_latest_date_marker) {
         $this->rebuild_known_range();
         return;
     }
     $current_min = tribe_events_earliest_date();
     $current_max = tribe_events_latest_date();
     $event_start = tribe_get_start_date($event_id, false, Tribe__Date_Utils::DBDATETIMEFORMAT);
     $event_end = tribe_get_end_date($event_id, false, Tribe__Date_Utils::DBDATETIMEFORMAT);
     if ($current_min > $event_start) {
         $this->rebuild_known_range();
         tribe_update_option('earliest_date', $event_start);
     }
     if ($current_max < $event_end) {
         $this->rebuild_known_range();
         tribe_update_option('latest_date', $event_end);
     }
 }
开发者ID:partisan-collective,项目名称:partisan,代码行数:32,代码来源:Known_Range.php


示例3: update_known_range

 /**
  * Intelligently updates our record of the earliest start date/latest event date in
  * the system. If the existing earliest/latest values have not been superseded by the new post's
  * start/end date then no update takes place.
  *
  * This is deliberately hooked into save_post, rather than save_post_tribe_events, to avoid issues
  * where the removal/restoration of hooks within addEventMeta() etc might stop this method from
  * actually being called (relates to a core WP bug).
  */
 public function update_known_range($object_id)
 {
     $current_min = tribe_events_earliest_date();
     $current_max = tribe_events_latest_date();
     $event_start = tribe_get_start_date($object_id, false, Tribe__Events__Date_Utils::DBDATETIMEFORMAT);
     $event_end = tribe_get_end_date($object_id, false, Tribe__Events__Date_Utils::DBDATETIMEFORMAT);
     if ($current_min > $event_start) {
         tribe_update_option('earliest_date', $event_start);
     }
     if ($current_max < $event_end) {
         tribe_update_option('latest_date', $event_end);
     }
 }
开发者ID:kevinaxu,项目名称:99boulders,代码行数:22,代码来源:Main.php


示例4: tribe_events_week_next_link

 /**
  * Build the next week link
  *
  * @param string $text the text to be linked
  *
  * @return string
  */
 function tribe_events_week_next_link($text = '')
 {
     try {
         $date = date(Tribe__Events__Date_Utils::DBDATEFORMAT, strtotime(tribe_get_first_week_day() . ' +1 week'));
         if ($date >= tribe_events_latest_date(Tribe__Events__Date_Utils::DBDATEFORMAT)) {
             return '';
         }
         $url = tribe_get_next_week_permalink();
         if (empty($text)) {
             $text = __('Next Week <span>&raquo;</span>', 'tribe-events-calendar-pro');
         }
         global $wp_query;
         $current_week = tribe_get_first_week_day($wp_query->get('start_date'));
         $attributes = sprintf(' data-week="%s" ', date('Y-m-d', strtotime($current_week . ' +7 days')));
         return sprintf('<a %s href="%s" rel="next">%s</a>', $attributes, esc_url($url), $text);
     } catch (OverflowException $e) {
         return '';
     }
 }
开发者ID:TravisSperry,项目名称:mpa_website,代码行数:26,代码来源:week.php


示例5: tribe_events_the_next_month_link

 /**
  * Display an html link to the next month. Used in the month navigation.
  *
  * @return void
  * @uses tribe_get_next_month_text()
  **/
 function tribe_events_the_next_month_link()
 {
     $html = '';
     $url = tribe_get_next_month_link();
     $text = tribe_get_next_month_text();
     // Check if $url is populated (an empty string may indicate the date was out-of-bounds, ie on 32bit servers)
     if (!empty($url)) {
         $date = Tribe__Events__Main::instance()->nextMonth(tribe_get_month_view_date());
         if ($date <= tribe_events_latest_date(Tribe__Events__Date_Utils::DBYEARMONTHTIMEFORMAT)) {
             $html = '<a data-month="' . $date . '" href="' . esc_url($url) . '" rel="next">' . $text . ' <span>&raquo;</span></a>';
         }
     }
     echo apply_filters('tribe_events_the_next_month_link', $html);
 }
开发者ID:simple-beck,项目名称:project-gc,代码行数:20,代码来源:month.php


示例6: tribe_next_week_link

 function tribe_next_week_link($text = '')
 {
     try {
         $date = date(TribeDateUtils::DBDATEFORMAT, strtotime(tribe_get_first_week_day() . ' +1 week'));
         if ($date >= tribe_events_latest_date(TribeDateUtils::DBDATEFORMAT)) {
             return '';
         }
         $url = tribe_get_next_week_permalink();
         if (empty($text)) {
             $text = __('Next Week <span>&raquo;</span>', 'tribe-events-calendar-pro');
         }
         return sprintf('<a %s href="%s" rel="next">%s</a>', tribe_events_the_nav_attributes('next', false), $url, $text);
     } catch (OverflowException $e) {
         return '';
     }
 }
开发者ID:TMBR,项目名称:johnjohn,代码行数:16,代码来源:week.php


示例7: update_earliest_latest

 /**
  * Intelligently updates our record of the earliest start date/latest event date in
  * the system. If the existing earliest/latest values have not been superseded by the new post's
  * start/end date then no update takes place.
  *
  * This is deliberately hooked into save_post, rather than save_post_tribe_events, to avoid issues
  * where the removal/restoration of hooks within addEventMeta() etc might stop this method from
  * actually being called (relates to a core WP bug).
  */
 public function update_earliest_latest($post_id)
 {
     // Bail if this isn't an event
     if (TribeEvents::POSTTYPE !== get_post_type($post_id)) {
         return;
     }
     // If the event isn't going to be visible (perhaps it's been trashed) rebuild dates and bail
     if (!in_array(get_post_status($post_id), array('publish', 'private', 'protected'))) {
         $this->rebuild_earliest_latest();
         return;
     }
     $current_min = tribe_events_earliest_date();
     $current_max = tribe_events_latest_date();
     $event_start = tribe_get_start_date($post_id, false, TribeDateUtils::DBDATETIMEFORMAT);
     $event_end = tribe_get_end_date($post_id, false, TribeDateUtils::DBDATETIMEFORMAT);
     if ($current_min > $event_start) {
         tribe_update_option('earliest_date', $event_start);
     }
     if ($current_max < $event_end) {
         tribe_update_option('latest_date', $event_end);
     }
 }
开发者ID:estrategasdigitales,项目名称:Golone,代码行数:31,代码来源:the-events-calendar.class.php


示例8: update_known_range

 /**
  * Intelligently updates our record of the earliest start date/latest event date in
  * the system. If the existing earliest/latest values have not been superseded by the new post's
  * start/end date then no update takes place.
  *
  * This is deliberately hooked into save_post, rather than save_post_tribe_events, to avoid issues
  * where the removal/restoration of hooks within addEventMeta() etc might stop this method from
  * actually being called (relates to a core WP bug).
  */
 public function update_known_range($meta_id, $object_id, $meta_key)
 {
     if (TribeEvents::POSTTYPE !== get_post_type($object_id)) {
         return;
     }
     if ('_EventDuration' !== $meta_key) {
         return;
     }
     $current_min = tribe_events_earliest_date();
     $current_max = tribe_events_latest_date();
     $event_start = tribe_get_start_date($object_id, false, TribeDateUtils::DBDATETIMEFORMAT);
     $event_end = tribe_get_end_date($object_id, false, TribeDateUtils::DBDATETIMEFORMAT);
     if ($current_min > $event_start) {
         tribe_update_option('earliest_date', $event_start);
     }
     if ($current_max < $event_end) {
         tribe_update_option('latest_date', $event_end);
     }
 }
开发者ID:Vinnica,项目名称:theboxerboston.com,代码行数:28,代码来源:the-events-calendar.class.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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