本文整理汇总了PHP中tribe_has_organizer函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_has_organizer函数的具体用法?PHP tribe_has_organizer怎么用?PHP tribe_has_organizer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_has_organizer函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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_template_part
tribe_get_template_part('modules/meta/details');
// If we have no map to embed and no need to keep the venue separate...
if (!$set_venue_apart && !tribe_embed_google_map()) {
tribe_get_template_part('modules/meta/venue');
} elseif (!$set_venue_apart && !tribe_has_organizer() && tribe_embed_google_map()) {
// If we have no organizer, no need to separate the venue but we have a map to embed...
tribe_get_template_part('modules/meta/venue');
echo '<div class="tribe-events-meta-group tribe-events-meta-group-gmap">';
tribe_get_template_part('modules/meta/map');
echo '</div>';
} else {
// If the venue meta has not already been displayed then it will be printed separately by default
$set_venue_apart = true;
}
// Include organizer meta if appropriate
if (tribe_has_organizer()) {
tribe_get_template_part('modules/meta/organizer');
}
do_action('tribe_events_single_event_meta_primary_section_end');
?>
<?php
if ($not_skeleton) {
?>
</div>
<?php
}
?>
<?php
开发者ID:selinaross,项目名称:spring-ridge,代码行数:31,代码来源:meta.php
示例3: tribe_events_single_event_meta
/**
* Return the single event meta
*
* @deprecated since 3.6
* @todo remove in 3.9
* @return string
**/
function tribe_events_single_event_meta()
{
// Use the new template driven approach to rendering meta data unless the user opts to use the old system
if (!apply_filters('tribe_events_single_event_meta_legacy_mode', false)) {
tribe_get_template_part('modules/meta');
return '';
}
// For users using the meta factory ("legacy mode")...
$event_id = get_the_ID();
$skeleton_mode = apply_filters('tribe_events_single_event_the_meta_skeleton', false, $event_id);
$group_venue = apply_filters('tribe_events_single_event_the_meta_group_venue', false, $event_id);
$html = '';
if ($skeleton_mode) {
// show all visible meta_groups in skeleton view
$html .= tribe_get_the_event_meta();
} else {
$html .= '<div class="tribe-events-single-section tribe-events-event-meta tribe-clearfix">';
// Event Details
$html .= tribe_get_meta_group('tribe_event_details');
// When there is no map show the venue info up top
if (!$group_venue && !tribe_embed_google_map($event_id)) {
// Venue Details
$html .= tribe_get_meta_group('tribe_event_venue');
$group_venue = false;
} else {
if (!$group_venue && !tribe_has_organizer($event_id) && tribe_address_exists($event_id) && tribe_embed_google_map($event_id)) {
$html .= sprintf('%s<div class="tribe-events-meta-group tribe-events-meta-group-gmap">%s</div>', tribe_get_meta_group('tribe_event_venue'), tribe_get_meta('tribe_venue_map'));
$group_venue = false;
} else {
$group_venue = true;
}
}
// Organizer Details
if (tribe_has_organizer($event_id)) {
$html .= tribe_get_meta_group('tribe_event_organizer');
}
$html .= apply_filters('tribe_events_single_event_the_meta_addon', '', $event_id);
$html .= '</div>';
}
if (!$skeleton_mode && $group_venue) {
// If there's a venue map and custom fields or organizer, show venue details in this seperate section
$venue_details = tribe_get_meta_group('tribe_event_venue') . tribe_get_meta('tribe_venue_map');
if (!empty($venue_details)) {
$html .= apply_filters('tribe_events_single_event_the_meta_venue_row', sprintf('<div class="tribe-events-single-section tribe-events-event-meta tribe-clearfix">%s</div>', $venue_details));
}
}
return apply_filters('tribe_events_single_event_meta', $html);
}
开发者ID:TMBR,项目名称:johnjohn,代码行数:55,代码来源:meta.php
示例4: sp_has_organizer
/**
* @deprecated
*/
function sp_has_organizer($postId = null)
{
_deprecated_function(__FUNCTION__, '2.0', 'tribe_has_organizer()');
return tribe_has_organizer($postId);
}
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:8,代码来源:deprecated.php
示例5: tribe_events_event_classes
<div class="single-event-popup <?php echo tribe_events_event_classes( $event_id ); ?>">
<div class="col-sm-4">
<?php echo tribe_event_featured_image( $event_id, 'event-popup', false ); ?>
</div>
<div class="col-sm-8">
<h2 class="event-title"><?php echo $event->post_title; ?></h2>
<?php echo apply_filters( 'the_content', $event->post_content ); ?>
<ul class="meta-info">
<li><label>What:</label> <?php echo $event->post_title; ?></li>
<li><label>When:</label> <?php echo tribe_events_event_schedule_details( $event_id ); ?></li>
<?php if ( tribe_address_exists( $event_id ) ) : ?>
<li><label>Where:</label> <?php echo tribe_get_full_address( $event_id ); ?></li>
<?php endif; ?>
<li><label>Cost:</label> <?php echo get_post_meta( $event_id, '_ecp_custom_2', true ); ?></li>
<?php if ( tribe_has_organizer( $event_id ) ): ?>
<li><label>Info:</label> <a href="mailto:<?php echo tribe_get_organizer_email( $event_id ); ?>"><?php echo tribe_get_organizer_email( $event_id ); ?></a></li>
<?php endif; ?>
<li><label>Register:</label> <?php echo get_post_meta( $event_id, '_ecp_custom_5', true ); ?></li>
</ul>
<?php echo bones_get_edit_link( $event_id ); ?>
</div>
</div>
开发者ID:simple-beck,项目名称:project-gc,代码行数:30,代码来源:_partial-single-event.php
示例6: do_action
<?php
do_action('tribe_events_single_event_meta_primary_section_start');
// Always include the main event details in this first section
tribe_get_template_part('modules/meta/details');
// Include organizer meta if appropriate
if (tribe_has_organizer()) {
tribe_get_template_part('modules/meta/organizer');
}
tribe_get_template_part('modules/meta/venue');
echo '<div class="tribe-events-meta-group tribe-events-meta-group-gmap">';
tribe_get_template_part('modules/meta/map');
echo '</div>';
// If we have no map to embed and no need to keep the venue separate...
if (!$set_venue_apart && !tribe_embed_google_map()) {
tribe_get_template_part('modules/meta/venue');
} elseif (!$set_venue_apart && !tribe_has_organizer() && tribe_embed_google_map()) {
// If we have no organizer, no need to separate the venue but we have a map to embed...
tribe_get_template_part('modules/meta/venue');
echo '<div class="tribe-events-meta-group tribe-events-meta-group-gmap">';
tribe_get_template_part('modules/meta/map');
echo '</div>';
} else {
// If the venue meta has not already been displayed then it will be printed separately by default
//$set_venue_apart = true;
$set_venue_apart = false;
}
do_action('tribe_events_single_event_meta_primary_section_end');
?>
<?php
if ($not_skeleton) {
开发者ID:CityOfPrescott,项目名称:tabula-rasa_city-of-prescott,代码行数:31,代码来源:meta.php
示例7: tribe_events_single_event_meta
/**
* Return the single event meta
*
* @return string
* @since 3.0
* @author Jessica Yazbek
**/
function tribe_events_single_event_meta()
{
$event_id = get_the_ID();
$skeleton_mode = apply_filters('tribe_events_single_event_the_meta_skeleton', false, $event_id);
$group_venue = apply_filters('tribe_events_single_event_the_meta_group_venue', false, $event_id);
$html = '';
if ($skeleton_mode) {
// show all visible meta_groups in skeleton view
$html .= tribe_get_the_event_meta();
} else {
$html .= '<div class="tribe-events-single-section tribe-events-event-meta tribe-clearfix">';
// Event Details
$html .= tribe_get_meta_group('tribe_event_details');
// When there is no map show the venue info up top
if (!$group_venue && !tribe_embed_google_map($event_id)) {
// Venue Details
$html .= tribe_get_meta_group('tribe_event_venue');
$group_venue = false;
} else {
if (!$group_venue && !tribe_has_organizer($event_id) && tribe_address_exists($event_id) && tribe_embed_google_map($event_id)) {
$html .= sprintf('%s<div class="tribe-events-meta-group">%s</div>', tribe_get_meta_group('tribe_event_venue'), tribe_get_meta('tribe_venue_map'));
$group_venue = false;
} else {
$group_venue = true;
}
}
// Organizer Details
if (tribe_has_organizer($event_id)) {
$html .= tribe_get_meta_group('tribe_event_organizer');
}
$html .= apply_filters('tribe_events_single_event_the_meta_addon', '', $event_id);
$html .= '</div>';
}
if (!$skeleton_mode && $group_venue) {
// If there's a venue map and custom fields or organizer, show venue details in this seperate section
$venue_details = tribe_get_meta_group('tribe_event_venue') . tribe_get_meta('tribe_venue_map');
if (!empty($venue_details)) {
$html .= apply_filters('tribe_events_single_event_the_meta_venue_row', sprintf('<div class="tribe-events-single-section tribe-events-event-meta tribe-clearfix">%s</div>', $venue_details));
}
}
return apply_filters('tribe_events_single_event_meta', $html);
}
开发者ID:TyRichards,项目名称:river_of_life,代码行数:49,代码来源:meta.php
示例8:
</a>
</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)) {
开发者ID:WestBayResidential,项目名称:wbrsorg,代码行数:31,代码来源:event-list.php
注:本文中的tribe_has_organizer函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论