当前位置: 首页>>代码示例>>PHP>>正文


PHP tribe_get_event_cat_slugs函数代码示例

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


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

示例1: event_classes

 /**
  * Generates and returns a set of classes for the current day
  *
  * @param  string $classes = ''
  *
  * @return string Classes
  */
 public function event_classes($classes = '')
 {
     $day = self::get_current_day();
     if (!isset($day['events'])) {
         return $classes;
     }
     $post = $day['events']->post;
     // Get our wrapper classes (for event categories, organizer, venue, and defaults)
     $classes = array();
     $tribe_cat_slugs = tribe_get_event_cat_slugs($post->ID);
     foreach ($tribe_cat_slugs as $tribe_cat_slug) {
         $classes[] = 'tribe-events-category-' . $tribe_cat_slug;
     }
     $classes = array_merge($classes, get_post_class('', $post->ID));
     if ($venue_id = tribe_get_venue_id($post->ID)) {
         $classes[] = 'tribe-events-venue-' . $venue_id;
     }
     foreach (tribe_get_organizer_ids($post->ID) as $organizer_id) {
         $classes[] = 'tribe-events-organizer-' . $organizer_id;
     }
     if ($day['events']->current_post + 1 == $day['events']->post_count) {
         $classes[] = 'tribe-events-last';
     }
     return $classes;
 }
开发者ID:acutedeveloper,项目名称:havering-intranet-development,代码行数:32,代码来源:Month.php

示例2: tribe_events_event_classes

 /**
  * Prints out or returns classes on an event wrapper
  *
  * @category Events
  * @param $event |0 post id or object
  * @param $echo  |true
  *
  * @return void or string
  **/
 function tribe_events_event_classes($event = 0, $echo = true)
 {
     global $post, $wp_query;
     // May be called when the global $post object does not exist - ie during ajax loads of various views
     // ... creating a dummy object allows the method to proceed semi-gracefully (interim measure only)
     //If $post object doesn't exist and an $event_id wasn't specified, then use a dummy object
     if (is_a('WP_Post', $event)) {
         $event_id = $event->ID;
     } elseif ($event !== 0) {
         $event_id = $event;
     } else {
         $event_id = $post->ID;
     }
     if (!$event_id) {
         return '';
     }
     $classes = array('hentry', 'vevent', 'type-tribe_events', 'post-' . $event_id, 'tribe-clearfix');
     $tribe_cat_slugs = tribe_get_event_cat_slugs($event_id);
     foreach ($tribe_cat_slugs as $tribe_cat_slug) {
         if (!empty($tribe_cat_slug)) {
             $classes[] = 'tribe-events-category-' . $tribe_cat_slug;
         }
     }
     if ($venue_id = tribe_get_venue_id($event_id)) {
         $classes[] = 'tribe-events-venue-' . $venue_id;
     }
     if ($organizer_id = tribe_get_organizer_id($event_id)) {
         $classes[] = 'tribe-events-organizer-' . $organizer_id;
     }
     // added first class for css
     if ($wp_query->current_post == 0 && !tribe_is_day()) {
         $classes[] = 'tribe-events-first';
     }
     // added last class for css
     if ($wp_query->current_post == $wp_query->post_count - 1) {
         $classes[] = 'tribe-events-last';
     }
     $classes = apply_filters('tribe_events_event_classes', $classes);
     if ($echo) {
         echo implode(' ', $classes);
     } else {
         return implode(' ', $classes);
     }
 }
开发者ID:TMBR,项目名称:johnjohn,代码行数:53,代码来源:general.php

示例3: event_classes

 /**
  * Add classes to events on this view
  *
  * @return array
  * @author Jessica Yazbek
  * @since 3.0
  **/
 public function event_classes($classes)
 {
     global $post, $wp_query;
     $classes = array_merge($classes, array('hentry', 'vevent', 'type-tribe_events', 'post-' . $post->ID, 'tribe-clearfix'));
     $tribe_cat_slugs = tribe_get_event_cat_slugs($post->ID);
     foreach ($tribe_cat_slugs as $tribe_cat_slug) {
         $classes[] = 'tribe-events-category-' . $tribe_cat_slug;
     }
     if ($venue_id = tribe_get_venue_id($post->ID)) {
         $classes[] = 'tribe-events-venue-' . $venue_id;
     }
     if ($organizer_id = tribe_get_organizer_id($post->ID)) {
         $classes[] = 'tribe-events-organizer-' . $organizer_id;
     }
     // added first class for css
     if ($wp_query->current_post == 0 && !tribe_is_day()) {
         $classes[] = 'tribe-events-first';
     }
     // added last class for css
     if ($wp_query->current_post == $wp_query->post_count - 1) {
         $classes[] = 'tribe-events-last';
     }
     return $classes;
 }
开发者ID:TyRichards,项目名称:river_of_life,代码行数:31,代码来源:tribe-template-factory.class.php

示例4: event_classes

 /**
  * css event wrapper classes used during loop
  *
  * @since  3.0
  * @author tim@imaginesimplicty.com
  * @return void
  */
 function event_classes()
 {
     if (self::$loop_type == 'allday') {
         $event = self::get_allday_event();
     } else {
         $event = self::get_hourly_event();
     }
     // Get our wrapper classes (for event categories, organizer, venue, and defaults)
     echo 'hentry vevent type-tribe_events post-' . $event->ID, ' tribe-clearfix ';
     // we need to adjust on behalf of weekly span scripts
     $day_span_length = $event->days_between + 1;
     if ($day_span_length > 0) {
         echo 'tribe-dayspan' . $day_span_length . ' ';
     }
     // if we have a venue add the class
     if ($venue_id = tribe_get_venue_id($event->ID)) {
         'tribe-events-venue-' . $venue_id . ' ';
     }
     // if we have an organizer add the class
     if ($organizer_id = tribe_get_organizer_id($event->ID)) {
         $classes[] = 'tribe-events-organizer-' . $organizer_id . ' ';
     }
     // add classes for all assigned categories
     $tribe_cat_slugs = tribe_get_event_cat_slugs($event->ID);
     foreach ($tribe_cat_slugs as $tribe_cat_slug) {
         echo 'tribe-events-category-' . $tribe_cat_slug . ' ';
     }
     if (self::$loop_type == 'hourly' && strtotime(self::$prior_event_date->EventStartDate) < strtotime($event->EventStartDate)) {
         echo 'tribe-event-overlap ';
     }
     self::$prior_event_date->EventStartDate = $event->EventStartDate;
 }
开发者ID:TyRichards,项目名称:river_of_life,代码行数:39,代码来源:week.php


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