本文整理汇总了PHP中tribe_get_venue_id函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_get_venue_id函数的具体用法?PHP tribe_get_venue_id怎么用?PHP tribe_get_venue_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_get_venue_id函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: generate_attendees_PDF
public final function generate_attendees_PDF($tickets_list)
{
$this->load_pdf_libraries();
$pdf = new FPDF();
$ecp = TribeEvents::instance();
$pdf->AddFont('OpenSans', '', 'opensans.php');
$pdf->AddFont('SteelFish', '', 'steelfish.php');
$pdf->SetTitle('EventTicket');
$pdf->SetAuthor('The Events Calendar');
$pdf->SetCreator('The Events Calendar');
$defaults = array('event_id' => 0, 'ticket_name' => '', 'holder_name' => '', 'order_id' => '', 'ticket_id' => '', 'security_code' => '');
foreach ($tickets_list as $ticket) {
$ticket = wp_parse_args($ticket, $defaults);
$event = get_post($ticket['event_id']);
$venue_id = tribe_get_venue_id($event->ID);
$venue = !empty($venue_id) ? get_post($venue_id)->post_title : '';
$address = tribe_get_address($event->ID);
$zip = tribe_get_zip($event->ID);
$state = tribe_get_stateprovince($event->ID);
$city = tribe_get_city($event->ID);
$pdf->AddPage();
$pdf->SetDrawColor(28, 166, 205);
$pdf->SetFillColor(28, 166, 205);
$pdf->Rect(15, 10, 180, 34, 'F');
$pdf->SetTextColor(255);
$pdf->SetFont('OpenSans', '', 10);
$pdf->SetXY(30, 15);
$pdf->Write(5, __('EVENT NAME:', 'tribe-events-calendar'));
$pdf->SetXY(30, 28);
$pdf->SetFont('SteelFish', '', 53);
$title = strtoupper(utf8_decode($event->post_title));
$size = 53;
while ($pdf->GetStringWidth($title) > 151) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $title);
$pdf->SetTextColor(41);
$pdf->SetFont('OpenSans', '', 10);
$pdf->SetXY(30, 50);
$pdf->Write(5, __('TICKET HOLDER:', 'tribe-events-calendar'));
$pdf->SetXY(104, 50);
$pdf->Write(5, __('LOCATION:', 'tribe-events-calendar'));
$pdf->SetFont('SteelFish', '', 30);
$pdf->SetXY(30, 59);
$holder = strtoupper(utf8_decode($ticket['holder_name']));
$size = 30;
while ($pdf->GetStringWidth($holder) > 70) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $holder);
$pdf->SetXY(104, 59);
$venue = strtoupper(utf8_decode($venue));
$size = 30;
while ($pdf->GetStringWidth($venue) > 70) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $venue);
$pdf->SetXY(104, 71);
$address = strtoupper(utf8_decode($address));
$size = 30;
while ($pdf->GetStringWidth($address) > 70) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $address);
$pdf->SetXY(104, 83);
$address2 = array($city, $state, $zip);
$address2 = array_filter($address2);
$address2 = join(', ', $address2);
$address2 = strtoupper(utf8_decode($address2));
$size = 30;
while ($pdf->GetStringWidth($address2) > 70) {
$size--;
$pdf->SetFontSize($size);
}
$pdf->Write(5, $address2);
$pdf->Line(15, 97, 195, 97);
$pdf->SetFont('OpenSans', '', 10);
$pdf->SetXY(30, 105);
$pdf->Write(5, __('ORDER:', 'tribe-events-calendar'));
$pdf->SetXY(80, 105);
$pdf->Write(5, __('TICKET:', 'tribe-events-calendar'));
$pdf->SetXY(120, 105);
$pdf->Write(5, __('VERIFICATION:', 'tribe-events-calendar'));
$pdf->SetFont('SteelFish', '', 53);
$pdf->SetXY(30, 118);
$pdf->Write(5, $ticket['order_id']);
$pdf->SetXY(80, 118);
$pdf->Write(5, $ticket['ticket_id']);
$pdf->SetXY(120, 118);
$pdf->Write(5, $ticket['security_code']);
$pdf->Rect(15, 135, 180, 15, 'F');
$pdf->SetTextColor(255);
$pdf->SetFont('OpenSans', '', 10);
$pdf->SetXY(30, 140);
$pdf->Write(5, get_bloginfo('name'));
$pdf->SetXY(104, 140);
//.........这里部分代码省略.........
开发者ID:mpaskew,项目名称:isc-dev,代码行数:101,代码来源:tribe-tickets.php
示例2: wpv_tribe_single_gmap
function wpv_tribe_single_gmap()
{
$the_id = tribe_get_venue_id($GLOBALS['wpv_single_event_id']);
$the_address = Tribe__Events__Main::instance()->fullAddressString($the_id);
if (get_post_meta($GLOBALS['wpv_single_event_id'], '_EventShowMap', true) == '1') {
echo WPV_Gmap::shortcode(array('address' => $the_address, 'height' => 500, 'html' => $the_address, 'popup' => true, 'scrollwheel' => false));
}
}
开发者ID:petrfaitl,项目名称:wordpress-event-theme,代码行数:8,代码来源:tribe-events-integration.php
示例3: event_details_top
/**
* Injects event meta data into the Attendees report
*
* @param int $event_id
*/
public function event_details_top($event_id)
{
$post_type = get_post_type($event_id);
if (Tribe__Events__Main::POSTTYPE === $post_type) {
echo '
<li>
<strong>' . esc_html__('Start Date:', 'the-events-calendar') . '</strong>
' . tribe_get_start_date($event_id, false, tribe_get_date_format(true)) . '
</li>
';
}
if (tribe_has_venue($event_id)) {
$venue_id = tribe_get_venue_id($event_id);
echo '
<li class="venue-name">
<strong>' . tribe_get_venue_label_singular() . ': </strong>
<a href="' . get_edit_post_link($venue_id) . '" title="' . esc_html__('Edit Venue', 'the-events-calendar') . '">' . tribe_get_venue($event_id) . '</a>
</li>
';
}
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:26,代码来源:Attendees_Report.php
示例4: 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
示例5: tribe_get_embedded_map
/**
* Google Map Embed
*
* Returns an embedded google maps for an event
*
* @param string $postId
* @param int $width
* @param int $height
* @param bool $force_load If true, then load the map even if an address is not provided.
* @return string An iframe pulling http://maps.google.com/ for this event
* @since 2.0
*/
function tribe_get_embedded_map($postId = null, $width = '', $height = '', $force_load = false)
{
$postId = TribeEvents::postIdHelper($postId);
if (!tribe_is_venue($postId) && !tribe_is_event($postId)) {
return false;
}
$postId = tribe_is_venue($postId) ? $postId : tribe_get_venue_id($postId);
$locationMetaSuffixes = array('address', 'city', 'state', 'province', 'zip', 'country');
$toUrlEncode = "";
foreach ($locationMetaSuffixes as $val) {
$metaVal = call_user_func('tribe_get_' . $val);
if ($metaVal) {
$toUrlEncode .= $metaVal . " ";
}
}
if ($toUrlEncode) {
$address = $toUrlEncode;
} else {
$address = null;
}
if (!$height) {
$height = tribe_get_option('embedGoogleMapsHeight', '350');
}
if (!$width) {
$width = tribe_get_option('embedGoogleMapsWidth', '100%');
}
if ($address || $force_load) {
ob_start();
include TribeEvents::instance()->pluginPath . 'admin-views/event-map.php';
$google_map = ob_get_contents();
ob_get_clean();
return $google_map;
} else {
return '';
}
}
开发者ID:mpaskew,项目名称:isc-dev,代码行数:48,代码来源:google-map.php
示例6: 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
示例7: _e
<h3 title="Click to toggle"><?php
_e('Event Summary', 'tribe-events-calendar');
?>
</h3>
<table class="eventtable ticket_list">
<tr>
<td width="33%" valign="top">
<?php
echo sprintf('<h4>%s</h4>', esc_html(__('Event Details', 'tribe-events-calendar')));
echo sprintf('<strong>%s </strong> %s', esc_html(__('Start Date / Time:', 'tribe-events-calendar')), tribe_get_start_date($event_id, false, get_option('date_format') . ' ' . get_option('time_format')));
echo "<br/>";
echo sprintf('<strong>%s </strong> %s', esc_html(__('End Date / Time:', 'tribe-events-calendar')), tribe_get_end_date($event_id, false, get_option('date_format') . ' ' . get_option('time_format')));
$venue_id = tribe_get_venue_id($event_id);
if (!empty($venue_id)) {
$venue = get_post($venue_id);
}
if (!empty($venue)) {
echo "<br/>";
echo sprintf('<strong>%s </strong> %s', esc_html(__('Venue:', 'tribe-events-calendar')), esc_html($venue->post_title));
$phone = get_post_meta($venue_id, '_VenuePhone', true);
if (!empty($phone)) {
echo "<br/>";
echo sprintf('<strong>%s </strong> %s', esc_html(__('Phone:', 'tribe-events-calendar')), esc_html($phone));
}
$website = get_post_meta($venue_id, '_VenueURL', true);
if (!empty($website)) {
echo "<br/>";
echo sprintf('<strong>%s </strong> <a target="_blank" href="%s">%s</a>', esc_html(__('Website:', 'tribe-events-calendar')), esc_url($website), esc_html($website));
开发者ID:donwea,项目名称:nhap.org,代码行数:31,代码来源:attendees.php
示例8: tribe_get_venue_website_link
/**
* Get the link for the venue website.
*
* @param null $post_id
* @param null $label
*
* @return string Formatted link to the venue website
*/
function tribe_get_venue_website_link($post_id = null, $label = null)
{
$post_id = tribe_get_venue_id($post_id);
$url = tribe_get_event_meta($post_id, '_VenueURL', 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_venue_website_link_target', 'self'), apply_filters('tribe_get_venue_website_link_label', $label));
} else {
$html = '';
}
return apply_filters('tribe_get_venue_website_link', $html);
}
开发者ID:NallelyFlores89,项目名称:cronica-ambiental,代码行数:26,代码来源:venue.php
示例9: get_ids
protected function get_ids($post_id)
{
$post_id = $post_id = Tribe__Events__Main::postIdHelper($post_id);
$this->event_id = tribe_is_event($post_id) ? $post_id : 0;
$this->venue_id = tribe_is_venue($post_id) ? $post_id : tribe_get_venue_id($post_id);
}
开发者ID:partisan-collective,项目名称:partisan,代码行数:6,代码来源:Embedded_Maps.php
示例10: sp_has_venue
/**
* @deprecated
*/
function sp_has_venue($postId = null)
{
_deprecated_function(__FUNCTION__, '2.0', 'tribe_get_venue_id()');
return tribe_get_venue_id($postId);
}
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:8,代码来源:deprecated.php
示例11: generate_markers
/**
* Generates the array of markers to pin the events in the Google Map embed in the map view
*
* @param $events
*
* @return array
*/
private function generate_markers($events)
{
$markers = array();
foreach ($events as $event) {
$venue_id = tribe_get_venue_id($event->ID);
$lat = get_post_meta($venue_id, self::LAT, true);
$lng = get_post_meta($venue_id, self::LNG, true);
$address = tribe_get_address($event->ID);
$title = $event->post_title;
$link = get_permalink($event->ID);
// replace commas with decimals in case they were saved with the european number format
$lat = str_replace(',', '.', $lat);
$lng = str_replace(',', '.', $lng);
$markers[] = array('lat' => $lat, 'lng' => $lng, 'title' => $title, 'address' => $address, 'link' => $link, 'venue_id' => $venue_id, 'event_id' => $event->ID);
}
return $markers;
}
开发者ID:pellio11,项目名称:ns-select-project,代码行数:24,代码来源:tribe-geoloc.class.php
示例12: tribe_get_venue_website_url
/**
* Returns the venue website URL related to the current post or for the optionally
* specified post.
*
* @param int|null $post_id
*
* @return string
*/
function tribe_get_venue_website_url($post_id = null)
{
return (string) tribe_get_event_meta(tribe_get_venue_id($post_id), '_VenueURL', true);
}
开发者ID:partisan-collective,项目名称:partisan,代码行数:12,代码来源:venue.php
示例13: tribe_get_venues
*/
// the query
global $post;
$venues = tribe_get_venues();
?>
<h2>Venues</h2>
<?php
foreach ($venues as $post) {
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();
开发者ID:lizbur10,项目名称:js_finalproject,代码行数:31,代码来源:list-organizers-venues.php
示例14: tribe_community_events_get_venue_description
/**
* Return Venue Description
*
* @param int|null $venue_id (optional)
* @return string
* @author Peter Chester
* @since 3.1
*/
function tribe_community_events_get_venue_description($venue_id = null)
{
$venue_id = tribe_get_venue_id($venue_id);
$description = $venue_id > 0 ? get_post($venue_id)->post_content : null;
return apply_filters('tribe_get_venue_description', $description);
}
开发者ID:donwea,项目名称:nhap.org,代码行数:14,代码来源:tribe-community-events-template-tags.php
示例15: event_classes
/**
* css event wrapper classes used during loop
*
* @since 3.0
* @author [email protected]
* @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
示例16: generate_markers
/**
* Generates the array of markers to pin the events in the Google Map embed in the map view
*
* @param $events
*
* @return array
*/
private function generate_markers($events)
{
$markers = array();
foreach ($events as $event) {
$venue_id = tribe_get_venue_id($event->ID);
$lat = get_post_meta($venue_id, self::LAT, true);
$lng = get_post_meta($venue_id, self::LNG, true);
$address = tribe_get_address($event->ID);
$title = $event->post_title;
$link = get_permalink($event->ID);
$markers[] = array('lat' => $lat, 'lng' => $lng, 'title' => $title, 'address' => $address, 'link' => $link);
}
return $markers;
}
开发者ID:Vinnica,项目名称:theboxerboston.com,代码行数:21,代码来源:tribe-geoloc.class.php
示例17: tribe_get_venue_single_line_address
/**
* Gets the venue name and address on a single line
*
* @param int $event_id Event ID
* @param boolean $link Whether or not to wrap the text in a venue link
*
* @return string
*/
function tribe_get_venue_single_line_address($event_id, $link = true)
{
$venue = null;
if (tribe_has_venue($event_id)) {
$venue_id = tribe_get_venue_id($event_id);
$venue_name = tribe_get_venue($event_id);
$venue_url = tribe_get_venue_link($event_id, false);
$venue_address = array('city' => tribe_get_city($event_id), 'stateprovince' => tribe_get_stateprovince($event_id), 'zip' => tribe_get_zip($event_id));
/**
* Filters the parts of a venue address
*
* @var array Array of address parts
* @var int Event ID
*/
$venue_address = apply_filters('tribe_events_venue_single_line_address_parts', $venue_address, $event_id);
// get rid of blank elements
$venue_address = array_filter($venue_address);
$venue = $venue_name;
$separator = _x(', ', 'Address separator', 'the-events-calendar');
if ($venue_address) {
$venue .= $separator . implode($separator, $venue_address);
}
if ($link && $venue_url) {
$attr_title = the_title_attribute(array('post' => $venue_id, 'echo' => false));
$venue = '<a href="' . esc_url($venue_url) . '" title="' . $attr_title . '">' . $venue . '</a>';
}
}
/**
* Filters the venue single-line address
*
* @var string Venue address line
* @var int Event ID
* @var boolean Whether or not the venue should be linked
*/
return apply_filters('tribe_events_get_venue_single_line_address', $venue, $event_id, $link);
}
开发者ID:nullify005,项目名称:shcc-website,代码行数:44,代码来源:venue.php
示例18: tribe_get_organizer_id
<?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>';
} else {
echo tribe_get_venue($post->ID);
}
}
?>
</td>
<td><?php
echo TribeEventsAdminList::custom_columns('events-cats', $post->ID, false);
?>
</td>
<?php
开发者ID:WestBayResidential,项目名称:wbrsorg,代码行数:31,代码来源:event-list.php
示例19: tribe_get_phone
/**
* Venue Phone Number
*
* Returns the venue phone number
*
* @param int $postId Can supply either event id or venue id, if none specified, current post is used
* @return string Phone number
* @since 2.0
*/
function tribe_get_phone($postId = null)
{
$postId = tribe_get_venue_id($postId);
$output = esc_html(tribe_get_event_meta($postId, '_VenuePhone', true));
return $output;
}
开发者ID:mpaskew,项目名称:isc-dev,代码行数:15,代码来源:venue.php
示例20: dt_sc_events
function dt_sc_events($atts, $content = null)
{
if (!function_exists('dt_events_list') && dttheme_is_plugin_active('the-events-calendar/the-events-calendar.php')) {
extract(shortcode_atts(array('limit' => '-1', 'carousel' => ''), $atts));
global $post;
$out = '';
$firstcnt = 2;
$post_thumbnail = 'blogcourse-three-column';
$tpl_default_settings = get_post_meta(get_the_ID(), '_tpl_default_settings', TRUE);
$tpl_default_settings = is_array($tpl_default_settings) ? $tpl_default_settings : array();
$page_layout = array_key_exists("layout", $tpl_default_settings) ? $tpl_default_settings['layout'] : "content-full-width";
if ($page_layout == 'with-left-sidebar' || $page_layout == 'with-right-sidebar') {
$post_thumbnail .= '-single-sidebar';
} elseif ($page_layout == 'both-sidebar') {
$post_thumbnail .= '-both-sidebar';
}
if ($carousel == 'true') {
$html_tag = 'li';
} else {
$html_tag = 'div';
}
$all_events = tribe_get_events(array('eventDisplay' => 'all', 'posts_per_page' => $limit));
$cnt = 0;
foreach ($all_events as $post) {
setup_postdata($post);
$temp_class = $firstcls = '';
if ($carousel != 'true') {
$no = $cnt + 1;
if ($no % $firstcnt == 1) {
$firstcls = ' first';
}
}
$out .= '<' . $html_tag . ' class="dt-sc-one-half column ' . $firstcls . '" id="post-' . get_the_ID() . '">';
$out .= '<div class="dt-sc-event-container">';
$out .= '<div class="dt-sc-event-thumb">';
$out .= '<a href="' . get_permalink() . '" title="' . get_the_title() . '">';
if (has_post_thumbnail()) {
$attr = array('title' => get_the_title());
$out .= get_the_post_thumbnail($post->ID, $post_thumbnail, $attr);
} else {
$out .= '<img src="http://placehold.it/1170x895&text=Image" alt="' . get_the_title() . '" />';
}
$out .= '</a>';
if (tribe_get_cost($post->ID) != '') {
$currency_symbol = tribe_get_event_meta($post->ID, '_EventCurrencySymbol', true);
if (!$currency_symbol) {
$currency_symbol = tribe_get_option('defaultCurrencySymbol', '$');
}
$currency_position = tribe_get_event_meta($post->ID, '_EventCurrencyPosition', true);
$out .= '<span class="event-price">';
if ($currency_position == 'suffix') {
$out .= tribe_get_cost($post->ID) . $currency_symbol;
} else {
$out .= $currency_symbol . tribe_get_cost($post->ID);
}
$out .= '</span>';
}
$out .= '</div>';
$out .= '<div class="dt-sc-event-content">';
$out .= '<h2><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>';
$out .= '<div class="dt-sc-event-meta">';
$out .= '<p> <i class="fa fa-calendar-o"> </i>' . tribe_get_start_date($post->ID, false, 'M Y @ h a') . ' - ' . tribe_get_end_date($post->ID, false, 'M Y @ h a') . ' </p>';
$venue_id = tribe_get_venue_id($post->ID);
if (isset($venue_id) && $venue_id > 0) {
$url = esc_url(get_permalink($venue_id));
$venue_name = tribe_get_venue($post->ID);
$out .= '<p> <i class="fa fa-map-marker"> </i>';
$out .= '<a href="' . $url . '">' . $venue_name . '</a>';
$out .= ', ' . tribe_get_country($post->ID);
if (tribe_get_map_link() != '') {
$out .= '<a href="' . tribe_get_map_link() . '" title="' . $venue_name . '" target="_blank">' . __(' + Google Map ', 'dt_themes') . '</a>';
}
$out .= '</p>';
}
$out .= '</div>';
$out .= '</div>';
$out .= '</div>';
$out .= '</' . $html_tag . '>';
$cnt++;
}
if ($carousel == 'true') {
return '<div class="dt-sc-events-carousel-wrapper"><ul class="dt-sc-events-carousel">' . $out . '</ul><div class="carousel-arrows"><a class="events-prev" href=""></a><a class="events-next" href=""></a></div></div>';
} else {
return $out;
}
} else {
return '';
}
}
开发者ID:enlacee,项目名称:anb.platicom.com.pe,代码行数:89,代码来源:shortcodes.php
注:本文中的tribe_get_venue_id函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论