本文整理汇总了PHP中tribe_get_event_link函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_get_event_link函数的具体用法?PHP tribe_get_event_link怎么用?PHP tribe_get_event_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_get_event_link函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: block_tribe_event_output
function block_tribe_event_output($params)
{
extract($params);
$default_excerpt_length = 650;
if (!isset($event_ID) || empty($event_ID)) {
return;
}
$event = get_post($event_ID);
// if block has event ID but the actual event does not exist then exit
if (!isset($event)) {
return;
}
// BLOCK CLASSES
$block_classes = "outter-wrapper";
if (!empty($custom_classes)) {
$block_classes .= " " . $custom_classes;
}
?>
<!-- BLOCK: LATEST POSTS-->
<!-- start outter-wrapper -->
<div <?php
pb_block_id_class($block_classes, $params);
?>
>
<!-- block styles -->
<style type="text/css" scoped>
<?php
include 'includes/inc_block_output_style.php';
?>
</style>
<!-- start main-container -->
<div class="main-container">
<!-- start main wrapper -->
<div class="main wrapper clearfix">
<!-- start main-content -->
<div class="main-content">
<!-- Start Post -->
<div class="clearfix tribe-events-tcblock">
<!-- Event Cost -->
<div class="tribe-events-event-cost">
<span><?php
echo tribe_get_formatted_cost($event_ID);
?>
</span>
</div>
<!-- Event Title -->
<h2 class="tribe-events-list-event-title summary">
<?php
printf('<a class="url" href="%s" title="%s" rel="bookmark">%s</a>', esc_url(tribe_get_event_link($event_ID)), esc_attr(get_the_title($event_ID)), esc_attr(get_the_title($event_ID)));
?>
</h2>
<!-- Event Image -->
<div class="tribe-events-event-image">
<?php
if (has_post_thumbnail($event_ID) && get_post(get_post_thumbnail_id($event_ID))) {
$post_thumbnail_src = wp_get_attachment_image_src(get_post_thumbnail_id($event_ID), 'full');
printf('<a href="%s" title="%s"><img src="%s" title="%s"/></a>', esc_url(tribe_get_event_link($event_ID)), esc_attr(get_the_title($event_ID)), esc_url($post_thumbnail_src[0]), esc_attr(get_the_title($event_ID)));
}
?>
</div>
<!-- Event Meta -->
<div class="tribe-events-event-meta vcard location">
<!-- Schedule & Recurrence Details -->
<div class="updated published time-details">
<?php
printf('<span class="date-start dtstart">%s</span>', esc_attr(tribe_get_start_date($event_ID)));
?>
</div>
<!-- Venue Display Info -->
<div class="tribe-events-venue-details">
<span class="author fn org"><?php
echo tribe_get_venue($event_ID);
?>
</span>,
<address class="tribe-events-address">
<span class="adr">
<span class="street-address"><?php
echo tribe_get_address($event_ID);
?>
</span>
<span class="delimiter">,</span>
<span class="locality"><?php
echo tribe_get_city($event_ID);
?>
</span>
//.........这里部分代码省略.........
开发者ID:jameymcelveen,项目名称:com.flyingtigersrc.www,代码行数:101,代码来源:block_tribe_event_output.php
示例2: add_recurring_event_view_link
/**
* Adds the View link for recurring events.
*
* @param array $actions The current action links.
* @return array The modified action links.
*/
public static function add_recurring_event_view_link($actions)
{
global $post;
if (function_exists('tribe_is_recurring_event') && is_array(self::$events_list) && tribe_is_recurring_event(self::$events_list[0]->ID) && isset(self::$events_list[0])) {
$actions['view'] = '<a href="' . tribe_get_event_link(self::$events_list[0]) . '" title="' . esc_attr(sprintf(__('View “%s”', 'tribe-events-calendar'), $post->post_title)) . '" rel="permalink">' . __('View', 'tribe-events-calendar') . '</a>';
}
return $actions;
}
开发者ID:scttrgd,项目名称:scottish-piping,代码行数:14,代码来源:tribe-admin-events-list.class.php
示例3: generate_countdown_output
/**
* Generate the hidden information to be passed to jQuery.
*/
public function generate_countdown_output($seconds, $complete, $hourformat, $event_ID, $event_date = null)
{
$event = get_post($event_ID);
if (!is_null($event_date)) {
$event->EventStartDate = $event_date;
}
$link = tribe_get_event_link($event);
return '
<div class="tribe-countdown-text"><a href="' . esc_url($link) . '">' . esc_attr($event->post_title) . '</a></div>
<div class="tribe-countdown-timer">
<span class="tribe-countdown-seconds">' . $seconds . '</span>
<span class="tribe-countdown-format">' . $hourformat . '</span>
' . $complete . '
</div>';
}
开发者ID:simple-beck,项目名称:project-gc,代码行数:18,代码来源:Countdown_Widget.php
示例4: ckhp_get_tribe_list
function ckhp_get_tribe_list($atts)
{
if (!function_exists('tribe_get_events')) {
return;
}
global $wp_query, $tribe_ecp, $post;
$output = '';
$ckhp_event_tax = '';
extract(shortcode_atts(array('cat' => '', 'number' => 5, 'class' => '', 'error' => 'y'), $atts, 'ckhp-tribe-events'), EXTR_PREFIX_ALL, 'ckhp');
$class = $atts['class'];
if ($ckhp_cat) {
$ckhp_event_tax = array(array('taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => $ckhp_cat));
}
$posts = tribe_get_events(apply_filters('tribe_events_list_widget_query_args', array('eventDisplay' => 'upcoming', 'posts_per_page' => $ckhp_number, 'tax_query' => $ckhp_event_tax)));
if (!isset($no_upcoming_events)) {
$no_upcoming_events = 0;
}
if ($posts && !$no_upcoming_events) {
if ($posts && !$no_upcoming_events) {
$output .= '<div class="event-calendar ' . $class . '">';
foreach ($posts as $post) {
setup_postdata($post);
$output .= '<a href="' . tribe_get_event_link() . '" rel="bookmark">';
$output .= '<div class="event-post">';
$output .= '<div class="event-date">';
$output .= '<time>' . sp_get_start_date($postId = null, $showtime = true, $dateFormat = 'M') . '<span>' . sp_get_start_date($postId = null, $showtime = true, $dateFormat = 'd') . '</span></time>';
$output .= '</div>';
$output .= '<div class="event-details">';
$output .= '<p>' . sp_get_start_date($postId = null, $showtime = true, $dateFormat = 'l') . ' ' . sp_get_start_date($postId = null, $showtime = true, $dateFormat = 'g:i a') . '</p>';
$output .= '<h4 class="media-heading">' . '<a href="' . tribe_get_event_link() . '" rel="bookmark">' . get_the_title() . '</a>' . '</h4>';
$output .= '</div>';
$output .= '</div>';
$output .= '</a>';
}
$output .= '</div><!-- .hfeed -->';
$output .= '<p class="tribe-events-widget-link"><a class="btn btn-primary btn-sm" href="' . tribe_get_events_link() . '" rel="bookmark">' . translate('View All Events', 'tribe-events-calendar') . '</a></p>';
}
} else {
//No Events were Found
$output .= $ckhp_error == 'y' ? '<p>' . translate('There are no upcoming events at this time.', 'tribe-events-calendar') . '</p>' : '';
}
// endif
wp_reset_query();
return $output;
}
开发者ID:breonwilliams,项目名称:boot-plus,代码行数:45,代码来源:recent-events.php
示例5: widget
function widget($args, $instance)
{
extract($args);
extract($instance);
// DEFAULTS
if (empty($instance)) {
$widget_title = __('Event', "loc_sport_widgets_plugin");
$excerpt_length = 650;
// get events
$events = tribe_get_events(array('eventDisplay' => 'all', 'orderby' => 'post_date', 'order' => 'DESC', 'numberposts' => 1));
$event_ID = $events[0]->ID;
}
$cost = tribe_get_formatted_cost($event_ID);
// WPML
if (function_exists('icl_translate')) {
$widget_title = icl_translate('loc_sport_widgets_plugin', "{$widget_id}-widget[widget_title]", $widget_title);
}
if (function_exists('icl_translate')) {
$cost = icl_translate('loc_sport_widgets_plugin', "{$widget_id}-widget[cost]", $cost);
}
if (!isset($event_ID) || empty($event_ID)) {
return;
}
$event = get_post($event_ID);
?>
<?php
echo $before_widget;
?>
<?php
if (!empty($widget_title)) {
echo $before_title . $widget_title . $after_title;
}
?>
<!-- Start Post -->
<div class="clearfix tribe-events-tcblock">
<!-- Event Cost -->
<div class="tribe-events-event-cost">
<span><?php
echo $cost;
?>
</span>
</div>
<!-- Event Title -->
<h2 class="tribe-events-list-event-title summary">
<?php
printf('<a class="url" href="%s" title="%s" rel="bookmark">%s</a>', esc_url(tribe_get_event_link($event_ID)), esc_attr(get_the_title($event_ID)), esc_attr(get_the_title($event_ID)));
?>
</h2>
<!-- Event Image -->
<div class="tribe-events-event-image">
<?php
if (has_post_thumbnail($event_ID) && get_post(get_post_thumbnail_id($event_ID))) {
$post_thumbnail_src = wp_get_attachment_image_src(get_post_thumbnail_id($event_ID), 'full');
printf('<a href="%s" title="%s"><img src="%s" title="%s"/></a>', esc_url(tribe_get_event_link($event_ID)), esc_attr(get_the_title($event_ID)), esc_url($post_thumbnail_src[0]), esc_attr(get_the_title($event_ID)));
}
?>
</div>
<!-- Event Meta -->
<div class="tribe-events-event-meta vcard location">
<!-- Schedule & Recurrence Details -->
<div class="updated published time-details">
<?php
printf('<span class="date-start dtstart">%s</span>', esc_attr(tribe_get_start_date($event_ID)));
?>
</div>
<!-- Venue Display Info -->
<div class="tribe-events-venue-details">
<span class="author fn org"><?php
echo tribe_get_venue($event_ID);
?>
</span>,
<address class="tribe-events-address">
<span class="adr">
<span class="street-address"><?php
echo tribe_get_address($event_ID);
?>
</span>
<span class="delimiter">,</span>
<span class="locality"><?php
echo tribe_get_city($event_ID);
?>
</span>
<span class="delimiter">,</span>
<span class="postal-code"><?php
echo tribe_get_zip($event_ID);
?>
</span>
//.........这里部分代码省略.........
开发者ID:jameymcelveen,项目名称:com.flyingtigersrc.www,代码行数:101,代码来源:widget_sport_single_event.php
示例6: tribe_events_event_schedule_details
<?php
}
?>
<div class="tribe-event-schedule-details">
<?php
echo tribe_events_event_schedule_details();
?>
</div>
<!-- Event Title -->
<?php
do_action('tribe_events_before_the_event_title');
?>
<h2 class="tribe-events-list-event-title">
<a class="tribe-event-url" href="<?php
echo esc_url(tribe_get_event_link());
?>
" title="<?php
the_title_attribute();
?>
" rel="bookmark">
<?php
the_title();
?>
</a>
</h2>
<?php
do_action('tribe_events_after_the_event_title');
?>
<!-- Event Meta -->
开发者ID:AC85,项目名称:musikschule-wp-theme,代码行数:31,代码来源:single-event.php
示例7: do_action
<?php
} else {
?>
<?php
do_action('tribe_events_venue_widget_before_the_list');
?>
<ul class="tribe-venue-widget-list">
<?php
while ($events->have_posts()) {
?>
<?php
$events->the_post();
?>
<li>
<h4><a href="<?php
echo tribe_get_event_link();
?>
"><?php
echo get_the_title(get_the_ID());
?>
</a></h4>
<?php
echo tribe_events_event_schedule_details();
?>
<?php
if (tribe_get_cost(get_the_ID()) != '') {
?>
<span class="tribe-events-divider">|</span>
<span class="tribe-events-event-cost">
<?php
echo tribe_get_cost(get_the_ID(), true);
开发者ID:pellio11,项目名称:ns-select-project,代码行数:31,代码来源:venue-widget.php
示例8: tribe_events_template_data
/**
* Returns json for javascript templating functions throughout the plugin.
*
* @category Events
*
* @param $event
* @param $additional
*
* @return string
*/
function tribe_events_template_data($event, array $additional = null)
{
$has_image = false;
$image_src = '';
$image_tool_src = '';
$date_display = '';
//Disable recurring event info in tooltip
if (class_exists('Tribe__Events__Pro__Main')) {
$ecp = Tribe__Events__Pro__Main::instance();
$ecp->disable_recurring_info_tooltip();
$date_display = strip_tags(tribe_events_event_schedule_details($event));
// Re-enable recurring event info
$ecp->enable_recurring_info_tooltip();
} else {
$date_display = strip_tags(tribe_events_event_schedule_details($event));
}
if (function_exists('has_post_thumbnail') && has_post_thumbnail($event->ID)) {
$has_image = true;
$image_arr = wp_get_attachment_image_src(get_post_thumbnail_id($event->ID), 'medium');
$image_src = $image_arr[0];
}
if ($has_image) {
$image_tool_arr = wp_get_attachment_image_src(get_post_thumbnail_id($event->ID), array(75, 75));
$image_tool_src = $image_tool_arr[0];
}
if (has_excerpt($event->ID)) {
$excerpt = $event->post_excerpt;
} else {
$excerpt = $event->post_content;
}
$excerpt = Tribe__Events__Main::instance()->truncate($excerpt, 30);
$category_classes = tribe_events_event_classes($event->ID, false);
$json = array('eventId' => $event->ID, 'title' => $event->post_title, 'permalink' => tribe_get_event_link($event->ID), 'imageSrc' => $image_src, 'dateDisplay' => $date_display, 'imageTooltipSrc' => $image_tool_src, 'excerpt' => $excerpt, 'categoryClasses' => $category_classes);
/**
* Template overrides (of month/tooltip.php) set up in 3.9.3 or earlier may still expect
* these vars and will break without them, so they are being kept temporarily for
* backwards compatibility purposes.
*
* @todo consider removing in 4.0
*/
$json['startTime'] = tribe_get_start_date($event);
$json['endTime'] = tribe_get_end_date($event);
if ($additional) {
$json = array_merge((array) $json, (array) $additional);
}
$json = apply_filters('tribe_events_template_data_array', $json, $event, $additional);
$json = tribe_prepare_for_json_deep($json);
return json_encode($json);
}
开发者ID:TMBR,项目名称:johnjohn,代码行数:59,代码来源:general.php
示例9: die
* @author Modern Tribe Inc.
*
*/
if (!defined('ABSPATH')) {
die('-1');
}
//Maximum Number of related posts to display
$num_posts = 3;
$posts = tribe_get_related_posts($num_posts);
?>
<?php
if (is_array($posts) && !empty($posts)) {
echo '<h3 class="tribe-events-related-events-title">' . __('Related Events', 'tribe-events-calendar-pro') . '</h3>';
echo '<ul class="tribe-related-events tribe-clearfix hfeed vcalendar">';
foreach ($posts as $post) {
echo '<li>';
$thumb = has_post_thumbnail($post->ID) ? get_the_post_thumbnail($post->ID, 'large') : '<img src="' . trailingslashit(TribeEventsPro::instance()->pluginUrl) . 'resources/images/tribe-related-events-placeholder.png" alt="' . get_the_title($post->ID) . '" />';
echo '<div class="tribe-related-events-thumbnail">';
echo '<a href="' . tribe_get_event_link($post) . '" class="url" rel="bookmark">' . $thumb . '</a>';
echo '</div>';
echo '<div class="tribe-related-event-info">';
echo '<h3 class="tribe-related-events-title summary"><a href="' . tribe_get_event_link($post) . '" class="url" rel="bookmark">' . get_the_title($post->ID) . '</a></h3>';
if ($post->post_type == TribeEvents::POSTTYPE) {
echo tribe_events_event_schedule_details($post);
}
echo '</div>';
echo '</li>';
}
echo '</ul>';
}
开发者ID:pellio11,项目名称:ns-select-project,代码行数:31,代码来源:related-events.php
示例10: inject_buy_button_into_oembed
/**
* Injects a buy/RSVP button into oembeds for events when necessary
*/
public function inject_buy_button_into_oembed()
{
$event_id = get_the_ID();
if (!tribe_events_has_tickets($event_id)) {
return;
}
$tickets = Tribe__Tickets__Tickets::get_all_event_tickets($event_id);
$has_non_rsvp = false;
$available = false;
$now = current_time('timestamp');
foreach ($tickets as $ticket) {
if ('Tribe__Tickets__RSVP' !== $ticket->provider_class) {
$has_non_rsvp = true;
}
if ($ticket->date_in_range($now) && $ticket->is_in_stock()) {
$available = true;
}
}
// if there aren't any tickets available, bail
if (!$available) {
return;
}
$button_text = $has_non_rsvp ? __('Buy', 'event-tickets') : __('RSVP', 'event-tickets');
/**
* Filters the text that appears in the buy/rsvp button on event oembeds
*
* @var string The button text
* @var int Event ID
*/
$button_text = apply_filters('event_tickets_embed_buy_button_text', $button_text, $event_id);
ob_start();
?>
<a class="tribe-event-buy" href="<?php
echo esc_url(tribe_get_event_link());
?>
" title="<?php
the_title_attribute();
?>
" rel="bookmark"><?php
echo esc_html($button_text);
?>
</a>
<?php
$buy_button = ob_get_clean();
/**
* Filters the buy button that appears on event oembeds
*
* @var string The button markup
* @var int Event ID
*/
echo apply_filters('event_tickets_embed_buy_button', $buy_button, $event_id);
}
开发者ID:TakenCdosG,项目名称:chefs,代码行数:55,代码来源:Main.php
示例11: get_event_link
/**
** Get a "previous/next post" link for events. Ordered by start date instead of ID.
**/
public function get_event_link($post, $mode = 'next', $anchor = false)
{
global $wpdb;
if ($mode == 'previous') {
$order = 'DESC';
$sign = '<';
} else {
$order = 'ASC';
$sign = '>';
}
$date = $post->EventStartDate;
$id = $post->ID;
$eventsQuery = "\n\t\t\t\tSELECT {$wpdb->posts}.*, d1.meta_value as EventStartDate\n\t\t\t\tFROM {$wpdb->posts} \n\t\t\t\tLEFT JOIN {$wpdb->postmeta} as d1 ON({$wpdb->posts}.ID = d1.post_id)\n\t\t\t\tWHERE {$wpdb->posts}.post_type = '" . self::POSTTYPE . "'\n\t\t\t\tAND d1.meta_key = '_EventStartDate'\n\t\t\t\tAND ((d1.meta_value = '" . $date . "' AND ID {$sign} " . $id . ") OR\n\t\t\t\t\td1.meta_value {$sign} '" . $date . "')\n\t\t\t\tAND {$wpdb->posts}.post_status = 'publish'\n\t\t\t\tAND ({$wpdb->posts}.ID != {$id} OR d1.meta_value != '{$date}')\n\t\t\t\tORDER BY TIMESTAMP(d1.meta_value) {$order}, ID {$order}\n\t\t\t\tLIMIT 1";
$results = $wpdb->get_row($eventsQuery, OBJECT);
if (is_object($results)) {
if (!$anchor) {
$anchor = $results->post_title;
} elseif (strpos($anchor, '%title%') !== false) {
$anchor = preg_replace('|%title%|', $results->post_title, $anchor);
}
echo '<a href=' . tribe_get_event_link($results) . '>' . $anchor . '</a>';
}
}
开发者ID:kevinreilly,项目名称:redwood-city-chamber-wp,代码行数:26,代码来源:the-events-calendar.class.php
示例12: tribe_mini_display_day
function tribe_mini_display_day($day, $monthView)
{
$return = "<div class='daynum tribe-events-event' id='daynum_{$day}'>";
$return .= count($monthView[$day]) ? "<a class='tribe-events-mini-has-event'>{$day}</a>" : $day;
$return .= "<div id='tooltip_day_{$day}' class='tribe-events-tooltip' style='display:none;'>";
for ($i = 0; $i < count($monthView[$day]); $i++) {
$post = $monthView[$day][$i];
setup_postdata($post);
$return .= '<h5 class="tribe-events-event-title-mini"><a href="' . tribe_get_event_link($post) . '">' . $post->post_title . '</a></h5>';
}
$return .= '<span class="tribe-events-arrow"></span>';
$return .= '</div>';
$return .= "</div>";
return $return;
}
开发者ID:EfncoPlugins,项目名称:the-events-calendar,代码行数:15,代码来源:table-mini.php
示例13: ecs_fetch_events
/**
* Fetch and return required events.
* @param array $atts shortcode attributes
* @return string shortcode output
*/
public function ecs_fetch_events($atts)
{
/**
* Check if events calendar plugin method exists
*/
if (!function_exists('tribe_get_events')) {
return;
}
global $wp_query, $post;
$output = '';
$atts = shortcode_atts(array('cat' => '', 'month' => '', 'limit' => 5, 'eventdetails' => 'true', 'time' => null, 'past' => null, 'venue' => 'false', 'author' => null, 'message' => sprintf(__('There are no upcoming %s at this time.', 'tribe-events-calendar'), tribe_get_event_label_plural()), 'key' => 'End Date', 'order' => 'ASC', 'viewall' => 'false', 'excerpt' => 'false', 'thumb' => 'false', 'thumbwidth' => '', 'thumbheight' => '', 'contentorder' => 'title, thumbnail, excerpt, date, venue', 'event_tax' => ''), $atts, 'ecs-list-events');
// Category
if ($atts['cat']) {
if (strpos($atts['cat'], ",") !== false) {
$atts['cats'] = explode(",", $atts['cat']);
$atts['cats'] = array_map('trim', $atts['cats']);
} else {
$atts['cats'] = $atts['cat'];
}
$atts['event_tax'] = array('relation' => 'OR', array('taxonomy' => 'tribe_events_cat', 'field' => 'name', 'terms' => $atts['cats']), array('taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => $atts['cats']));
}
// Past Event
$meta_date_compare = '>=';
$meta_date_date = date('Y-m-d');
if ($atts['time'] == 'past' || !empty($atts['past'])) {
$meta_date_compare = '<';
}
// Key
if (str_replace(' ', '', trim(strtolower($atts['key']))) == 'startdate') {
$atts['key'] = '_EventStartDate';
} else {
$atts['key'] = '_EventEndDate';
}
// Date
$atts['meta_date'] = array(array('key' => $atts['key'], 'value' => $meta_date_date, 'compare' => $meta_date_compare, 'type' => 'DATETIME'));
// Specific Month
if ($atts['month'] == 'current') {
$atts['month'] = date('Y-m');
}
if ($atts['month']) {
$month_array = explode("-", $atts['month']);
$month_yearstr = $month_array[0];
$month_monthstr = $month_array[1];
$month_startdate = date($month_yearstr . "-" . $month_monthstr . "-1");
$month_enddate = date($month_yearstr . "-" . $month_monthstr . "-t");
$atts['meta_date'] = array(array('key' => $atts['key'], 'value' => array($month_startdate, $month_enddate), 'compare' => 'BETWEEN', 'type' => 'DATETIME'));
}
$posts = get_posts(array('post_type' => 'tribe_events', 'posts_per_page' => $atts['limit'], 'tax_query' => $atts['event_tax'], 'meta_key' => $atts['key'], 'orderby' => 'meta_value', 'author' => $atts['author'], 'order' => $atts['order'], 'meta_query' => array($atts['meta_date'])));
if ($posts) {
$output .= '<ul class="ecs-event-list">';
$atts['contentorder'] = explode(',', $atts['contentorder']);
foreach ($posts as $post) {
setup_postdata($post);
$li_classes = 'ecs-event';
$start_date = tribe_get_start_date($post, false, 'Y-m-d');
$today = date('Y-m-d', current_time('timestamp'));
$tomorrow = date('Y-m-d', strtotime('tomorrow', current_time('timestamp')));
if ($start_date == $today) {
$li_classes .= ' ecs-today';
} else {
if ($start_date == $tomorrow) {
$li_classes .= ' ecs-tomorrow';
}
}
$output .= '<li class="' . $li_classes . '">';
// Put Values into $output
foreach ($atts['contentorder'] as $contentorder) {
switch (trim($contentorder)) {
case 'title':
$output .= '<h4 class="entry-title summary">' . '<a href="' . tribe_get_event_link() . '" rel="bookmark">' . apply_filters('ecs_event_list_title', get_the_title(), $atts) . '</a>
</h4>';
break;
case 'thumbnail':
if (self::isValid($atts['thumb'])) {
$thumbWidth = is_numeric($atts['thumbwidth']) ? $atts['thumbwidth'] : '';
$thumbHeight = is_numeric($atts['thumbheight']) ? $atts['thumbheight'] : '';
if (!empty($thumbWidth) && !empty($thumbHeight)) {
$output .= get_the_post_thumbnail($post->ID, array($thumbWidth, $thumbHeight));
} else {
$size = !empty($thumbWidth) && !empty($thumbHeight) ? array($thumbWidth, $thumbHeight) : 'medium';
if ($thumb = get_the_post_thumbnail($post->ID, $size)) {
$output .= '<a href="' . tribe_get_event_link() . '">';
$output .= $thumb;
$output .= '</a>';
}
}
}
break;
case 'excerpt':
if (self::isValid($atts['excerpt'])) {
$excerptLength = is_numeric($atts['excerpt']) ? $atts['excerpt'] : 100;
$output .= '<p class="ecs-excerpt">' . self::get_excerpt($excerptLength) . '</p>';
}
break;
case 'date':
//.........这里部分代码省略.........
开发者ID:rclilly,项目名称:The-Events-Calendar-Shortcode,代码行数:101,代码来源:the-events-calendar-shortcode.php
示例14: Avada
?>
<div class="tribe-related-events-thumbnail hover-type-<?php
echo Avada()->settings->get('ec_hover_type');
?>
">
<a href="<?php
echo esc_url(tribe_get_event_link($post));
?>
" class="url" rel="bookmark"><?php
echo $thumb;
?>
</a>
</div>
<div class="tribe-related-event-info">
<h3 class="tribe-related-events-title summary"><a href="<?php
echo tribe_get_event_link($post);
?>
" class="url" rel="bookmark"><?php
echo get_the_title($post->ID);
?>
</a></h3>
<?php
if ($post->post_type == Tribe__Events__Main::POSTTYPE) {
echo tribe_events_event_schedule_details($post);
}
?>
</div>
</li>
<?php
}
?>
开发者ID:sdxlgc,项目名称:net-wp_sdgcxl-htdocs,代码行数:31,代码来源:related-events.php
示例15: tribe_event_andre_image
function tribe_event_andre_image($post_id = null, $size = 'full', $link = true)
{
if (is_null($post_id)) {
$post_id = get_the_ID();
}
$image_html = get_the_post_thumbnail($post_id, $size, array('itemprop' => 'image'));
$featured_image = '';
//if link is not specifically excluded, then include <a>
if (!empty($image_html) && $link) {
$featured_image .= '<div class="tribe-events-event-image"><a href="' . esc_url(tribe_get_event_link()) . '">' . $image_html . '</a></div>';
} elseif (!empty($image_html)) {
$featured_image .= '<div class="tribe-events-event-image">' . $image_html . '</div>';
}
return apply_filters('tribe_event_featured_image', $featured_image, $post_id, $size);
}
开发者ID:montreyw,项目名称:Theme-Redesign-and-SEO-Overhaul,代码行数:15,代码来源:single-event.php
示例16: ecs_fetch_events
/**
* Fetch and return required events.
* @param array $atts shortcode attributes
* @return string shortcode output
*/
public function ecs_fetch_events($atts)
{
/**
* Check if events calendar plugin method exists
*/
if (!function_exists('tribe_get_events')) {
return;
}
global $wp_query, $post;
$output = '';
$ecs_event_tax = '';
extract(shortcode_atts(array('cat' => '', 'month' => '', 'limit' => 5, 'eventdetails' => 'true', 'time' => null, 'past' => null, 'venue' => 'false', 'author' => null, 'message' => 'There are no upcoming events at this time.', 'key' => 'End Date', 'order' => 'ASC', 'viewall' => 'false', 'excerpt' => 'false', 'thumb' => 'false', 'thumbwidth' => '', 'thumbheight' => '', 'contentorder' => 'title, thumbnail, excerpt, date, venue'), $atts, 'ecs-list-events'), EXTR_PREFIX_ALL, 'ecs');
// Category
if ($ecs_cat) {
$ecs_cats = explode(",", $ecs_cat);
$ecs_cats = array_map('trim', $ecs_cats);
$ecs_event_tax = array(array('taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => $ecs_cat));
}
// Past Event
$meta_date_compare = '>=';
$meta_date_date = date('Y-m-d');
if ($ecs_time == 'past' || !empty($ecs_past)) {
$meta_date_compare = '<';
}
// Key
if (str_replace(' ', '', trim(strtolower($ecs_key))) == 'startdate') {
$ecs_key = '_EventStartDate';
} else {
$ecs_key = '_EventEndDate';
}
// Date
$ecs_meta_date = array(array('key' => $ecs_key, 'value' => $meta_date_date, 'compare' => $meta_date_compare, 'type' => 'DATETIME'));
// Specific Month
if ($ecs_month == 'current') {
$ecs_month = date('Y-m');
}
if ($ecs_month) {
$month_array = explode("-", $ecs_month);
$month_yearstr = $month_array[0];
$month_monthstr = $month_array[1];
$month_startdate = date($month_yearstr . "-" . $month_monthstr . "-1");
$month_enddate = date($month_yearstr . "-" . $month_monthstr . "-t");
$ecs_meta_date = array(array('key' => $ecs_key, 'value' => array($month_startdate, $month_enddate), 'compare' => 'BETWEEN', 'type' => 'DATETIME'));
}
$posts = get_posts(array('post_type' => 'tribe_events', 'posts_per_page' => $ecs_limit, 'tax_query' => $ecs_event_tax, 'meta_key' => $ecs_key, 'orderby' => 'meta_value', 'author' => $ecs_author, 'order' => $ecs_order, 'meta_query' => array($ecs_meta_date)));
if ($posts) {
$output .= '<ul class="ecs-event-list">';
$ecs_contentorder = explode(',', $ecs_contentorder);
foreach ($posts as $post) {
setup_postdata($post);
$output .= '<li class="ecs-event">';
// Put Values into $output
foreach ($ecs_contentorder as $contentorder) {
switch (trim($contentorder)) {
case 'title':
$output .= '<h4 class="entry-title summary">' . '<a href="' . tribe_get_event_link() . '" rel="bookmark">' . get_the_title() . '</a>
</h4>';
break;
case 'thumbnail':
if (self::isValid($ecs_thumb)) {
$thumbWidth = is_numeric($ecs_thumbwidth) ? $ecs_thumbwidth : '';
$thumbHeight = is_numeric($ecs_thumbheight) ? $ecs_thumbheight : '';
if (!empty($thumbWidth) && !empty($thumbHeight)) {
$output .= get_the_post_thumbnail(get_the_ID(), array($thumbWidth, $thumbHeight));
} else {
$output .= get_the_post_thumbnail(get_the_ID(), 'medium');
}
}
break;
case 'excerpt':
if (self::isValid($ecs_excerpt)) {
$excerptLength = is_numeric($ecs_excerpt) ? $ecs_excerpt : 100;
$output .= '<p class="ecs-excerpt">' . self::get_excerpt($excerptLength) . '</p>';
}
break;
case 'date':
if (self::isValid($ecs_eventdetails)) {
$output .= '<span class="duration time">' . tribe_events_event_schedule_details() . '</span>';
}
break;
case 'venue':
if (self::isValid($ecs_venue)) {
$output .= '<span class="duration venue"><em> at </em>' . tribe_get_venue() . '</span>';
}
break;
}
}
$output .= '</li>';
}
$output .= '</ul>';
if (self::isValid($ecs_viewall)) {
$output .= '<span class="ecs-all-events"><a href="' . tribe_get_events_link() . '" rel="bookmark">' . translate('View All Events', 'tribe-events-calendar') . '</a></span>';
}
} else {
//No Events were Found
//.........这里部分代码省略.........
开发者ID:aelia-co,项目名称:The-Events-Calendar-Shortcode,代码行数:101,代码来源:the-events-calendar-shortcode.php
示例17: get_event_link
/**
* Get a "previous/next post" link for events. Ordered by start date instead of ID.
*
* @param WP_Post $post The post/event.
* @param string $mode Either 'next' or 'previous'.
* @param mixed $anchor
*
* @return string The link (with <a> tags).
*/
public function get_event_link($post, $mode = 'next', $anchor = false)
{
global $wpdb;
if ($mode == 'previous') {
$order = 'DESC';
$sign = '<';
} else {
$order = 'ASC';
$sign = '>';
}
$date = $post->EventStartDate;
$id = $post->ID;
$eventsQuery = $wpdb->prepare("\n\t\t\t\tSELECT {$wpdb->posts}.*, d1.meta_value as EventStartDate\n\t\t\t\tFROM {$wpdb->posts}\n\t\t\t\tLEFT JOIN {$wpdb->postmeta} as d1 ON({$wpdb->posts}.ID = d1.post_id)\n\t\t\t\tWHERE {$wpdb->posts}.post_type = '%s'\n\t\t\t\tAND d1.meta_key = '_EventStartDate'\n\t\t\t\tAND ((d1.meta_value = '%s' AND ID {$sign} %d) OR\n\t\t\t\t\td1.meta_value {$sign} '%s')\n\t\t\t\tAND {$wpdb->posts}.post_status = 'publish'\n\t\t\t\tAND ({$wpdb->posts}.ID != %d OR d1.meta_value != '%s')\n\t\t\t\tORDER BY TIMESTAMP(d1.meta_value) {$order}, ID {$order}\n\t\t\t\tLIMIT 1", self::POSTTYPE, $date, $id, $date, $id, $date);
$args = array('post_type' => self::POSTTYPE, 'post_status' => 'publish', 'post__not_in' => array($post->ID), 'order' => $order, 'orderby' => "TIMESTAMP({$wpdb->postmeta}.meta_value) ID", 'posts_per_page' => 1, 'meta_query' => array(array('key' => '_EventStartDate', 'value' => $post->EventStartDate, 'type' => 'DATE')));
// TODO: Finish rewriting this query to be WP_QUERY based
// TribeEventsQuery::deregister();
// $event_link = new WP_Query($args);
// print_r($event_link);
$results = $wpdb->get_row($eventsQuery, OBJECT);
if (is_object($results)) {
if (!$anchor) {
$anchor = $results->post_title;
} elseif (strpos($anchor, '%title%') !== false) {
$anchor = preg_replace('|%title%|', $results->post_title, $anchor);
}
return apply_filters('tribe_events_get_event_link', '<a href="' . tribe_get_event_link($results) . '">' . $anchor . '</a>');
}
}
开发者ID:donwea,项目名称:nhap.org,代码行数:37,代码来源:the-events-calendar.class.php
示例18: hijack_ticket_link
/**
* Replaces the link to the product with a link to the Event in the
* order confirmation page.
*
* @param $url
* @param $product_id
*
* @return string
*/
public function hijack_ticket_link($url, $product_id)
{
$event = get_post_meta($product_id, $this->event_key, true);
if (!empty($event)) {
$url = tribe_get_event_link($event);
}
return $url;
}
|
请发表评论