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


PHP tribe_get_organizer_id函数代码示例

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


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

示例1: get_data

 /**
  * Fetches the JSON-LD data for this type of object
  *
  * @param  int|WP_Post|null $post The post/event
  * @param  array  $args
  * @return array
  */
 public function get_data($posts = null, $args = array())
 {
     $posts = $posts instanceof WP_Post ? array($posts) : (array) $posts;
     $return = array();
     foreach ($posts as $i => $post) {
         $data = parent::get_data($post, $args);
         // If we have an Empty data we just skip
         if (empty($data)) {
             continue;
         }
         // Fetch first key
         $post_id = key($data);
         // Fetch first Value
         $data = reset($data);
         $event_tz_string = get_post_meta($post_id, '_EventTimezone', true);
         $tz_mode = tribe_get_option('tribe_events_timezone_mode', 'event');
         $tz_string = $event_tz_string && $tz_mode === 'event' ? $event_tz_string : Tribe__Events__Timezones::wp_timezone_string();
         $data->startDate = Tribe__Events__Timezones::to_utc(tribe_get_start_date($post_id, true, Tribe__Date_Utils::DBDATETIMEFORMAT), $tz_string, 'c');
         $data->endDate = Tribe__Events__Timezones::to_utc(tribe_get_end_date($post_id, true, Tribe__Date_Utils::DBDATETIMEFORMAT), $tz_string, 'c');
         if (tribe_has_venue($post_id)) {
             $venue_id = tribe_get_venue_id($post_id);
             $venue_data = Tribe__Events__JSON_LD__Venue::instance()->get_data($venue_id);
             $data->location = reset($venue_data);
         }
         if (tribe_has_organizer($post_id)) {
             $organizer_id = tribe_get_organizer_id($post_id);
             $organizer_data = Tribe__Events__JSON_LD__Organizer::instance()->get_data($organizer_id);
             $data->organizer = reset($organizer_data);
         }
         $price = tribe_get_cost($post_id);
         $price = $this->normalize_price($price);
         if ('' !== $price) {
             // Manually Include the Price for non Event Tickets
             $data->offers = (object) array('@type' => 'Offer', 'price' => $price, 'url' => $data->url);
         }
         $return[$post_id] = $data;
     }
     return $return;
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:46,代码来源:Event.php

示例2: tribe_get_organizer_website_link

 /**
  * Organizer website link
  *
  * Returns the event Organizer Name with a link to their supplied website
  *
  * @param $post_id post ID for an event
  * @param $label   text for the link
  *
  * @return string
  **/
 function tribe_get_organizer_website_link($post_id = null, $label = null)
 {
     $post_id = tribe_get_organizer_id($post_id);
     $url = tribe_get_event_meta($post_id, '_OrganizerWebsite', true);
     if (!empty($url)) {
         $label = is_null($label) ? $url : $label;
         if (!empty($url)) {
             $parseUrl = parse_url($url);
             if (empty($parseUrl['scheme'])) {
                 $url = "http://{$url}";
             }
         }
         $html = sprintf('<a href="%s" target="%s">%s</a>', esc_url($url), apply_filters('tribe_get_organizer_website_link_target', '_self'), apply_filters('tribe_get_organizer_website_link_label', $label));
     } else {
         $html = '';
     }
     return apply_filters('tribe_get_organizer_website_link', $html);
 }
开发者ID:duongnguyen92,项目名称:tvd12v2,代码行数:28,代码来源:organizer.php

示例3: generate_ical_feed

 /**
  * Generates the iCal file
  *
  * @static
  *
  * @param int|null $post If you want the ical file for a single event
  */
 public static function generate_ical_feed($post = null)
 {
     $tec = Tribe__Events__Main::instance();
     $events = '';
     $blogHome = get_bloginfo('url');
     $blogName = get_bloginfo('name');
     if ($post) {
         $events_posts = is_array($post) ? $post : array($post);
     } else {
         if (tribe_is_month()) {
             $events_posts = self::get_month_view_events();
         } else {
             global $wp_query;
             $events_posts = $wp_query->posts;
         }
     }
     $event_ids = wp_list_pluck($events_posts, 'ID');
     foreach ($events_posts as $event_post) {
         // add fields to iCal output
         $item = array();
         $full_format = 'Ymd\\THis';
         $time = (object) array('start' => self::wp_strtotime($event_post->EventStartDate), 'end' => self::wp_strtotime($event_post->EventEndDate), 'modified' => self::wp_strtotime($event_post->post_modified), 'created' => self::wp_strtotime($event_post->post_date));
         if ('yes' == get_post_meta($event_post->ID, '_EventAllDay', true)) {
             $type = 'DATE';
             $format = 'Ymd';
         } else {
             $type = 'DATE-TIME';
             $format = $full_format;
         }
         $tzoned = (object) array('start' => date($format, $time->start), 'end' => date($format, $time->end), 'modified' => date($format, $time->modified), 'created' => date($format, $time->created));
         if ('DATE' === $type) {
             $item[] = "DTSTART;VALUE={$type}:" . $tzoned->start;
             $item[] = "DTEND;VALUE={$type}:" . $tzoned->end;
         } else {
             $tz = get_option('timezone_string');
             $item[] = 'DTSTART;TZID="' . $tz . '":' . $tzoned->start;
             $item[] = 'DTEND;TZID="' . $tz . '":' . $tzoned->end;
         }
         $item[] = 'DTSTAMP:' . date($full_format, time());
         $item[] = 'CREATED:' . $tzoned->created;
         $item[] = 'LAST-MODIFIED:' . $tzoned->modified;
         $item[] = 'UID:' . $event_post->ID . '-' . $time->start . '-' . $time->end . '@' . parse_url(home_url('/'), PHP_URL_HOST);
         $item[] = 'SUMMARY:' . str_replace(array(',', "\n", "\r", "\t"), array('\\,', '\\n', '', '\\t'), html_entity_decode(strip_tags($event_post->post_title), ENT_QUOTES));
         $item[] = 'DESCRIPTION:' . str_replace(array(',', "\n", "\r", "\t"), array('\\,', '\\n', '', '\\t'), html_entity_decode(strip_tags($event_post->post_content), ENT_QUOTES));
         $item[] = 'URL:' . get_permalink($event_post->ID);
         // add location if available
         $location = $tec->fullAddressString($event_post->ID);
         if (!empty($location)) {
             $str_location = str_replace(array(',', "\n"), array('\\,', '\\n'), html_entity_decode($location, ENT_QUOTES));
             $item[] = 'LOCATION:' . $str_location;
         }
         // add geo coordinates if available
         if (class_exists('Tribe__Events__Pro__Geo_Loc')) {
             $long = Tribe__Events__Pro__Geo_Loc::instance()->get_lng_for_event($event_post->ID);
             $lat = Tribe__Events__Pro__Geo_Loc::instance()->get_lat_for_event($event_post->ID);
             if (!empty($long) && !empty($lat)) {
                 $item[] = sprintf('GEO:%s;%s', $lat, $long);
                 $str_title = str_replace(array(',', "\n"), array('\\,', '\\n'), html_entity_decode(tribe_get_address($event_post->ID), ENT_QUOTES));
                 if (!empty($str_title) && !empty($str_location)) {
                     $item[] = 'X-APPLE-STRUCTURED-LOCATION;VALUE=URI;X-ADDRESS=' . str_replace('\\,', '', trim($str_location)) . ';' . 'X-APPLE-RADIUS=500;' . 'X-TITLE=' . trim($str_title) . ':geo:' . $long . ',' . $lat;
                 }
             }
         }
         // add categories if available
         $event_cats = (array) wp_get_object_terms($event_post->ID, Tribe__Events__Main::TAXONOMY, array('fields' => 'names'));
         if (!empty($event_cats)) {
             $item[] = 'CATEGORIES:' . html_entity_decode(join(',', $event_cats), ENT_QUOTES);
         }
         // add featured image if available
         if (has_post_thumbnail($event_post->ID)) {
             $thumbnail_id = get_post_thumbnail_id($event_post->ID);
             $thumbnail_url = wp_get_attachment_url($thumbnail_id);
             $thumbnail_mime_type = get_post_mime_type($thumbnail_id);
             $item[] = apply_filters('tribe_ical_feed_item_thumbnail', sprintf('ATTACH;FMTTYPE=%s:%s', $thumbnail_mime_type, $thumbnail_url), $event_post->ID);
         }
         // add organizer if available
         $organizer_email = tribe_get_organizer_email($event_post->ID);
         if ($organizer_email) {
             $organizer_id = tribe_get_organizer_id($event_post->ID);
             $organizer = get_post($organizer_id);
             if ($organizer_id) {
                 $item[] = sprintf('ORGANIZER;CN="%s":MAILTO:%s', rawurlencode($organizer->post_title), $organizer_email);
             } else {
                 $item[] = sprintf('ORGANIZER:MAILTO:%s', $organizer_email);
             }
         }
         $item = apply_filters('tribe_ical_feed_item', $item, $event_post);
         $events .= "BEGIN:VEVENT\r\n" . implode("\r\n", $item) . "\r\nEND:VEVENT\r\n";
     }
     header('Content-type: text/calendar; charset=UTF-8');
     header('Content-Disposition: attachment; filename="ical-event-' . implode($event_ids) . '.ics"');
     $content = "BEGIN:VCALENDAR\r\n";
     $content .= "VERSION:2.0\r\n";
//.........这里部分代码省略.........
开发者ID:AC85,项目名称:musikschule-wp-theme,代码行数:101,代码来源:iCal.php

示例4: event_classes

 /**
  * Generates and returns a set of classes for the current day
  *
  * @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('hentry', 'vevent');
     $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;
     }
     if ($organizer_id = tribe_get_organizer_id($post->ID)) {
         $classes[] = 'tribe-events-organizer-' . $organizer_id;
     }
     if ($day['events']->current_post + 1 == $day['events']->post_count) {
         $classes[] = 'tribe-events-last';
     }
     return $classes;
 }
开发者ID:estrategasdigitales,项目名称:Golone,代码行数:30,代码来源:month.php

示例5: 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

示例6: 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

示例7: 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

示例8: tribe_get_organizer_id

							</span>
							<?php 
        if ($canEdit) {
            echo TribeCommunityEvents::instance()->getEditButton($post, 'Edit', '<span class="edit wp-admin events-cal"> |', '</span> ');
        }
        if ($canDelete) {
            echo TribeCommunityEvents::instance()->getDeleteButton($post);
        }
        ?>
						</div><!-- .row-actions -->
						</td>

						<td>
						<?php 
        if (tribe_has_organizer($post->ID)) {
            $organizer_id = tribe_get_organizer_id($post->ID);
            if (current_user_can('edit_post', $organizer_id)) {
                echo '<a href="' . TribeCommunityEvents::instance()->getUrl('edit', $organizer_id, null, TribeEvents::ORGANIZER_POST_TYPE) . '">' . tribe_get_organizer($post->ID) . '</a>';
            } else {
                echo tribe_get_organizer($post->ID);
            }
        }
        ?>
						</td>

						<td>
						<?php 
        if (tribe_has_venue($post->ID)) {
            $venue_id = tribe_get_venue_id($post->ID);
            if (current_user_can('edit_post', $venue_id)) {
                echo '<a href="' . TribeCommunityEvents::instance()->getUrl('edit', $venue_id, null, TribeEvents::VENUE_POST_TYPE) . '">' . tribe_get_venue($post->ID) . '</a>';
开发者ID:WestBayResidential,项目名称:wbrsorg,代码行数:31,代码来源:event-list.php

示例9: setup_postdata

    setup_postdata($post);
    ?>

	<p><?php 
    the_title();
    ?>
:  <?php 
    echo tribe_get_venue_id();
    ?>
</p>

	<?php 
}
$organizers = tribe_get_organizers();
?>
<h2>Organizers</h2>
<?php 
foreach ($organizers as $post) {
    setup_postdata($post);
    ?>

	<p><?php 
    the_title();
    ?>
:  <?php 
    echo tribe_get_organizer_id();
    ?>
</p>

	<?php 
}
开发者ID:lizbur10,项目名称:js_finalproject,代码行数:31,代码来源:list-organizers-venues.php

示例10: tribe_community_events_get_organizer_description

/**
 * Return Organizer Description
 *
 * @param int|null $organizer_id (optional)
 * @return string
 * @author Peter Chester
 * @since 3.1
 */
function tribe_community_events_get_organizer_description($organizer_id = null)
{
    $organizer_id = tribe_get_organizer_id($organizer_id);
    $description = $organizer_id > 0 ? get_post($organizer_id)->post_content : null;
    return apply_filters('tribe_get_organizer_description', $description);
}
开发者ID:donwea,项目名称:nhap.org,代码行数:14,代码来源:tribe-community-events-template-tags.php

示例11: tribe_get_organizer_phone

 /**
  * Organizer Phone
  *
  * Returns the event Organizer's phone number
  *
  * @param int $postId Can supply either event id or organizer id, if none specified, current post is used
  * @return string Organizer's Phone Number
  * @since 2.0
  */
 function tribe_get_organizer_phone($postId = null)
 {
     $postId = TribeEvents::postIdHelper($postId);
     $output = esc_html(tribe_get_event_meta(tribe_get_organizer_id($postId), '_OrganizerPhone', true));
     return apply_filters('tribe_get_organizer_phone', $output);
 }
开发者ID:mpaskew,项目名称:isc-dev,代码行数:15,代码来源:organizer.php

示例12: get_field

			

							<?php 
if (get_field('class_dishes')) {
    echo '<div class="class-dishes vertically-ruled"><h4>Dishes We\'ll Cover</h4>' . get_field('class_dishes') . '</div>';
}
?>
			

							<?php 
if (have_posts()) {
    ?>
							

							<?php 
    $post_id = tribe_get_organizer_id();
    $queried_post = get_post($post_id);
    ?>
			      		
			      				<div class="vertically-ruled" itemprop="performer" itemscope itemtype="http://schema.org/Person">
									<h4>About the Instructor</h4>
											<p itemprop="description"><?php 
    echo $queried_post->post_content;
    wp_reset_query();
    ?>
</p>
								</div> <!-- /.sub-pod-mini -->
					
							<?php 
}
?>
开发者ID:smartassdesign,项目名称:ngix,代码行数:29,代码来源:single-event.php


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