public static function print_all_events_link() { if (tribe_is_recurring_event()) { ?> <p class="tribe-events-back tribe-events-loop"> <a href="<?php echo esc_url(tribe_get_events_link()); ?> "> <?php printf('« ' . esc_html__('All %s', 'the-events-calendar'), tribe_get_event_label_plural()); ?> </a> </p> <?php } }
<?php /** * Month View Single Day * This file contains one day in the month grid * * Override this template in your own theme by creating a file at [your-theme]/tribe-events/month/single-day.php * * @package TribeEventsCalendar * */ if (!defined('ABSPATH')) { die('-1'); } $day = tribe_events_get_current_month_day(); $events_label = 1 === $day['total_events'] ? tribe_get_event_label_singular() : tribe_get_event_label_plural(); ?> <!-- Day Header --> <div id="tribe-events-daynum-<?php echo $day['daynum-id']; ?> "> <?php if ($day['total_events'] > 0 && tribe_events_is_view_enabled('day')) { ?> <a href="<?php echo esc_url(tribe_get_day_link($day['date'])); ?> "><?php echo $day['daynum']; ?>
* readme on templates hooks and filters * * @package TribeEventsCalendarPro * */ if (!defined('ABSPATH')) { die('-1'); } $posts = tribe_get_related_posts(); if (is_array($posts) && !empty($posts)) { ?> <div class="related-posts single-related-posts"> <?php echo do_shortcode(sprintf('[title size="3" content_align="left" sep_color="%s" style_type="default"]%s[/title]', Avada()->settings->get('ec_border_color'), sprintf(__('Related %s', 'tribe-events-calendar-pro'), tribe_get_event_label_plural()))); ?> <ul class="tribe-related-events tribe-clearfix hfeed vcalendar"> <?php foreach ($posts as $post) { ?> <li> <?php $thumb = has_post_thumbnail($post->ID) ? get_the_post_thumbnail($post->ID, 'large') : '<img src="' . esc_url(trailingslashit(Tribe__Events__Pro__Main::instance()->pluginUrl) . 'src/resources/images/tribe-related-events-placeholder.png') . '" alt="' . esc_attr(get_the_title($post->ID)) . '" />'; ?> <div class="tribe-related-events-thumbnail hover-type-<?php echo Avada()->settings->get('ec_hover_type'); ?> ">
<?php /** * List View Nav Template * This file loads the list view navigation. * * Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/nav.php * * @package TribeEventsCalendar * */ global $wp_query; $events_label_plural = tribe_get_event_label_plural(); if (!defined('ABSPATH')) { die('-1'); } ?> <h3 class="tribe-events-visuallyhidden"><?php echo esc_html(sprintf(esc_html__('%s List Navigation', 'the-events-calendar'), $events_label_plural)); ?> </h3> <ul class="tribe-events-sub-nav"> <!-- Left Navigation --> <?php if (tribe_has_previous_event()) { ?> <li class="<?php echo esc_attr(tribe_left_navigation_classes()); ?>
/** * Generates the markup for the "iCal Import" link for the views. */ public static function maybe_add_link() { global $wp_query; $show_ical = apply_filters('tribe_events_list_show_ical_link', true); if (!$show_ical) { return; } if (tribe_is_month() && !tribe_events_month_has_events()) { return; } if (is_single() || !have_posts()) { return; } $tec = Tribe__Events__Main::instance(); $view = $tec->displaying; if (defined('DOING_AJAX') && DOING_AJAX && isset($wp_query->query_vars['eventDisplay'])) { $view = $wp_query->query_vars['eventDisplay']; } switch (strtolower($view)) { case 'month': $modifier = sprintf(esc_html__("Month's %s", 'the-events-calendar'), tribe_get_event_label_plural()); break; case 'week': $modifier = sprintf(esc_html__("Week's %s", 'the-events-calendar'), tribe_get_event_label_plural()); break; case 'day': $modifier = sprintf(esc_html__("Day's %s", 'the-events-calendar'), tribe_get_event_label_plural()); break; default: $modifier = sprintf(esc_html__('Listed %s', 'the-events-calendar'), tribe_get_event_label_plural()); break; } $text = apply_filters('tribe_events_ical_export_text', esc_html__('Export', 'the-events-calendar') . ' ' . $modifier); $title = esc_html__('Use this to share calendar data with Google Calendar, Apple iCal and other compatible apps', 'the-events-calendar'); $ical = '<a class="tribe-events-ical tribe-events-button" title="' . $title . '" href="' . esc_url(tribe_get_ical_link()) . '">+ ' . $text . '</a>'; //echo $ical; }
/** * Sets an appropriate no results found message. */ protected function nothing_found_notice() { $events_label_plural = tribe_get_event_label_plural(); list($search_term, $tax_term, $geographic_term) = $this->get_search_terms(); if (!empty($search_term)) { Tribe__Events__Main::setNotice('event-search-no-results', sprintf(__('There were no results found for <strong>"%s"</strong> this month. Try searching next month.', 'tribe-events-calendar'), esc_html($search_term))); } elseif (!empty($tax_term)) { Tribe__Events__Main::setNotice('events-not-found', sprintf(__('No matching %s listed under %s. Please try viewing the full calendar for a complete list of events.', 'tribe-events-calendar'), strtolower($events_label_plural), $tax_term)); } else { Tribe__Events__Main::setNotice('event-search-no-results', __('There were no results found.', 'tribe-events-calendar')); } }
*/ if (!defined('ABSPATH')) { die('-1'); } $venue_id = get_the_ID(); while (have_posts()) { the_post(); ?> <div class="tribe-events-venue"> <p class="tribe-events-back"> <a href="<?php echo esc_url(tribe_get_events_link()); ?> " rel="bookmark"><?php printf(__('← Back to %s', 'tribe-events-calendar-pro'), tribe_get_event_label_plural()); ?> </a> </p> <div class="tribe-events-venue-meta vcard tribe-clearfix"> <?php if (tribe_embed_google_map() && tribe_address_exists()) { ?> <!-- Venue Map --> <div class="tribe-events-map-wrap"> <?php echo tribe_get_embedded_map($venue_id, '100%', '200px'); ?> </div><!-- .tribe-events-map-wrap -->
protected function nothing_found_notice() { $events_label_plural = tribe_get_event_label_plural(); list($search_term, $tax_term, $geographic_term) = $this->get_search_terms(); if (empty($search_term) && empty($geographic_term) && !empty($tax_term)) { Tribe__Events__Main::setNotice('events-not-found', sprintf(__('No matching %s listed under %s scheduled for <strong>%s</strong>. Please try another day.', 'tribe-events-calendar'), strtolower($events_label_plural), $tax_term, date_i18n(tribe_get_date_format(true), strtotime(get_query_var('eventDate'))))); } elseif (empty($search_term) && empty($geographic_term)) { Tribe__Events__Main::setNotice('events-not-found', sprintf(__('No %s scheduled for <strong>%s</strong>. Please try another day.', 'tribe-events-calendar'), strtolower($events_label_plural), date_i18n(tribe_get_date_format(true), strtotime(get_query_var('eventDate'))))); } else { parent::nothing_found_notice(); } }
* You can use any or all filters included in this file or create your own filters in * your functions.php. In order to modify or extend a single filter, please see our * readme on templates hooks and filters * * @package TribeEventsCalendarPro * */ if (!defined('ABSPATH')) { die('-1'); } $posts = tribe_get_related_posts(); if (is_array($posts) && !empty($posts)) { ?> <h3 class="tribe-events-related-events-title"><?php printf(__('Related %s', 'tribe-events-calendar-pro'), tribe_get_event_label_plural()); ?> </h3> <ul class="tribe-related-events tribe-clearfix"> <?php foreach ($posts as $post) { ?> <li> <?php $thumb = has_post_thumbnail($post->ID) ? get_the_post_thumbnail($post->ID, 'large') : '<img src="' . esc_url(trailingslashit(Tribe__Events__Pro__Main::instance()->pluginUrl) . 'src/resources/images/tribe-related-events-placeholder.png') . '" alt="' . esc_attr(get_the_title($post->ID)) . '" />'; ?> <div class="tribe-related-events-thumbnail"> <a href="<?php echo esc_url(tribe_get_event_link($post)); ?>
/** * This Week - Title * * @param string $this_week_title * * @return string */ function tribe_events_get_this_week_title($start_date) { $events_label_plural = tribe_get_event_label_plural(); $date_format = apply_filters('tribe_events_pro_page_title_date_format', tribe_get_date_format(true)); $this_week_title = sprintf(__('%s for week of %s', 'tribe-events-calendar-pro'), $events_label_plural, date_i18n($date_format, strtotime($start_date))); return $this_week_title; }
echo esc_attr($filter['name']); ?> "><?php echo $filter['caption']; ?> </label> <?php echo $filter['html']; ?> </div> <?php } ?> <div class="tribe-bar-submit"> <input class="tribe-events-button tribe-no-param" type="submit" name="submit-bar" value="<?php printf(__('Find %s', 'rescue'), tribe_get_event_label_plural()); ?> " /> </div><!-- .tribe-bar-submit --> </div><!-- .tribe-bar-filters-inner --> </div><!-- .tribe-bar-filters --> <?php } // if ( !empty( $filters ) ) ?> </form><!-- #tribe-bar-form --> </div><!-- #tribe-events-bar --> <?php
/** * This Week Widget - Data Attributes for Ajax * * */ public static function this_week_template_vars($this_week_query_vars) { $this_week_template_vars['layout'] = $this_week_query_vars['layout']; $this_week_template_vars['start_date'] = $this_week_query_vars['start_date']; $this_week_template_vars['end_date'] = $this_week_query_vars['end_date']; $this_week_template_vars['hide_weekends'] = $this_week_query_vars['hide_weekends']; $this_week_template_vars['events_label_singular'] = tribe_get_event_label_singular(); $this_week_template_vars['events_label_plural'] = tribe_get_event_label_plural(); return $this_week_template_vars; }
do_action('tribe_events_widget_list_inside_after_loop'); ?> <?php } ?> </ol><!-- .hfeed --> <p class="tribe-events-widget-link"> <a class="button radius" href="<?php esc_attr_e(esc_url($link_to_all)); ?> " rel="bookmark"> <?php _e('View More…', 'rescue'); ?> </a> </p> <?php // No Events were found. } else { ?> <p><?php printf(__('There are no upcoming %s at this time.', 'rescue'), strtolower(tribe_get_event_label_plural())); ?> </p> <?php } // Cleanup. Do not remove this. wp_reset_postdata();
/** * Event Title * * Return an event's title with pseudo-breadcrumb if on a category * * @param bool $depth include linked title * * @return string title * @todo move logic to template classes */ function tribe_get_events_title($depth = true) { $events_label_plural = tribe_get_event_label_plural(); global $wp_query; $tribe_ecp = Tribe__Events__Main::instance(); $title = sprintf(__('Upcoming %s', 'tribe-events-calendar'), $events_label_plural); // If there's a date selected in the tribe bar, show the date range of the currently showing events if (isset($_REQUEST['tribe-bar-date']) && $wp_query->have_posts()) { if ($wp_query->get('paged') > 1) { // if we're on page 1, show the selected tribe-bar-date as the first date in the range $first_event_date = tribe_get_start_date($wp_query->posts[0], false); } else { //otherwise show the start date of the first event in the results $first_event_date = tribe_event_format_date($_REQUEST['tribe-bar-date'], false); } $last_event_date = tribe_get_end_date($wp_query->posts[count($wp_query->posts) - 1], false); $title = sprintf(__('%1$s for %2$s - %3$s', 'tribe-events-calendar'), $events_label_plural, $first_event_date, $last_event_date); } elseif (tribe_is_past()) { $title = sprintf(__('Past %s', 'tribe-events-calendar'), $events_label_plural); } if (tribe_is_month()) { $title = sprintf(__('%1$s for %2$s', 'tribe-events-calendar'), $events_label_plural, date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date()))); } // day view title if (tribe_is_day()) { $title = sprintf(__('%1$s for %2$s', 'tribe-events-calendar'), $events_label_plural, date_i18n(tribe_get_date_format(true), strtotime($wp_query->get('start_date')))); } if (is_tax($tribe_ecp->get_event_taxonomy()) && $depth) { $cat = get_queried_object(); $title = '<a href="' . esc_url(tribe_get_events_link()) . '">' . $title . '</a>'; $title .= ' › ' . $cat->name; } return apply_filters('tribe_get_events_title', $title, $depth); }
function tribe_recurring_instances_toggle($postId = null) { $hide_recurrence = !empty($_REQUEST['tribeHideRecurrence']) && $_REQUEST['tribeHideRecurrence'] == '1' || empty($_REQUEST['tribeHideRecurrence']) && empty($_REQUEST['action']) && tribe_get_option('hideSubsequentRecurrencesDefault', false) ? '1' : false; if (!tribe_is_week() && !tribe_is_month()) { echo '<span class="tribe-events-user-recurrence-toggle">'; echo '<label for="tribeHideRecurrence">'; echo '<input type="checkbox" name="tribeHideRecurrence" value="1" id="tribeHideRecurrence" ' . checked($hide_recurrence, 1, false) . '>' . sprintf(__('Show only the first upcoming instance of recurring %s', 'tribe-events-calendar-pro'), strtolower(tribe_get_event_label_plural())); echo '</label>'; echo '</span>'; } }
<?php do_action('tribe_events_widget_list_inside_after_loop'); ?> <?php } ?> <p class="tribe-events-widget-link"> <a href="<?php esc_attr_e(esc_url($link_to_all)); ?> " rel="bookmark"> <?php esc_html_e('View More…', 'tribe-events-calendar-pro'); ?> </a> </p> <?php // No Events were found. } else { ?> <p><?php printf(__('There are no upcoming %s at this time.', 'the-events-calendar'), strtolower(tribe_get_event_label_plural())); ?> </p> <?php } // Cleanup. Do not remove this. wp_reset_postdata();
* your functions.php. In order to modify or extend a single filter, please see our * readme on templates hooks and filters * * @package TribeEventsCalendarPro * */ if (!defined('ABSPATH')) { die('-1'); } $posts = tribe_get_related_posts(); if (is_array($posts) && !empty($posts)) { ?> <div class="related-posts single-related-posts"> <?php echo Avada()->template->title_template(sprintf(__('Related %s', 'tribe-events-calendar-pro'), tribe_get_event_label_plural()), '3'); ?> <ul class="tribe-related-events tribe-clearfix hfeed vcalendar"> <?php foreach ($posts as $post) { ?> <li> <?php $thumb = has_post_thumbnail($post->ID) ? get_the_post_thumbnail($post->ID, 'large') : '<img src="' . esc_url(trailingslashit(Tribe__Events__Pro__Main::instance()->pluginUrl) . 'src/resources/images/tribe-related-events-placeholder.png') . '" alt="' . esc_attr(get_the_title($post->ID)) . '" />'; ?> <div class="tribe-related-events-thumbnail hover-type-<?php echo Avada()->settings->get('ec_hover_type'); ?> "> <a href="<?php
/** * Returns json for javascript templating functions throughout the plugin. * * @category Events * * @param $event * @param $additional * * @return string */ function tribe_events_template_data($event = null, array $additional = null) { // Base JSON variable $json = array('i18n' => array()); if (!is_null($event)) { $event = get_post($event); // Check if we are dealing with an Event if (is_object($event) && $event instanceof WP_Post && tribe_is_event($event->ID)) { $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['eventId'] = $event->ID; $json['title'] = $event->post_title; $json['permalink'] = tribe_get_event_link($event->ID); $json['imageSrc'] = $image_src; $json['dateDisplay'] = $date_display; $json['imageTooltipSrc'] = $image_tool_src; $json['excerpt'] = $excerpt; $json['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); } } /** * Internationalization Strings */ $json['i18n']['find_out_more'] = esc_attr__('Find out more »', 'tribe-events-calendar'); $json['i18n']['for_date'] = esc_attr(sprintf(__('%s for', 'tribe-events-calendar'), tribe_get_event_label_plural())); 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); }
/** * 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': if (self::isValid($atts['eventdetails'])) { $output .= '<span class="duration time">' . apply_filters('ecs_event_list_details', tribe_events_event_schedule_details(), $atts) . '</span>'; } break; case 'venue': if (self::isValid($atts['venue'])) { $output .= '<span class="duration venue">' . apply_filters('ecs_event_list_venue', ' <em>at</em> ' . tribe_get_venue(), $atts) . '</span>'; } break; } } $output .= '</li>'; } $output .= '</ul>'; if (self::isValid($atts['viewall'])) { $output .= '<span class="ecs-all-events"><a href="' . apply_filters('ecs_event_list_viewall_link', tribe_get_events_link(), $atts) . '" rel="bookmark">' . translate(apply_filters('ecs_event_list_viewall_text', 'View All Events', $atts), 'tribe-events-calendar') . '</a></span>'; } } else { //No Events were Found $output .= translate($atts['message'], 'tribe-events-calendar'); } // endif wp_reset_query(); return $output; }
/** * HTML Before Event (Display) * * Display HTML to output before the event template * * @category Events */ function tribe_events_before_html() { $events_label_plural = tribe_get_event_label_plural(); $before = stripslashes(tribe_get_option('tribeEventsBeforeHTML', '')); $before = wptexturize($before); $before = convert_chars($before); $before = wpautop($before); $before = do_shortcode(stripslashes(shortcode_unautop($before))); $before = '<div class="tribe-events-before-html">' . $before . '</div>'; $before = $before . '<span class="tribe-events-ajax-loading"><img class="tribe-events-spinner-medium" src="' . tribe_events_resource_url('images/tribe-loading.gif') . '" alt="' . sprintf(__('Loading %s', 'tribe-events-calendar'), $events_label_plural) . '" /></span>'; echo apply_filters('tribe_events_before_html', $before); }
<div class="events-nav-bar"> <form id="tribe-bar-form" class="tribe-clearfix" name="tribe-bar-form" method="post" action="<?php echo esc_attr( $current_url ); ?>"> <?php if ( ! empty( $filters ) ) { ?> <div class="tribe-bar-filters"> <div class="tribe-bar-filters-inner tribe-clearfix"> <?php foreach ( $filters as $filter ) : ?> <div class="<?php echo esc_attr( $filter['name'] ) ?>-filter"> <label class="label-<?php echo esc_attr( $filter['name'] ) ?>" for="<?php echo esc_attr( $filter['name'] ) ?>"><?php echo $filter['caption'] ?></label> <?php echo $filter['html'] ?> </div> <?php endforeach; ?> <div class="tribe-bar-submit"> <input class="tribe-events-button tribe-no-param" type="submit" name="submit-bar" value="<?php echo esc_attr( sprintf( __( 'Find %s', 'tribe-events-calendar' ), tribe_get_event_label_plural() ) ); ?>" /> </div> <!-- .tribe-bar-submit --> </div> <!-- .tribe-bar-filters-inner --> </div><!-- .tribe-bar-filters --> <?php } // if ( !empty( $filters ) ) ?> </form> </div> <div class="events-content-wrap"> <?php tribe_show_month(); ?> </div>
echo esc_attr($filter['name']); ?> "><?php echo $filter['caption']; ?> </label> <?php echo $filter['html']; ?> </div> <?php } ?> <div class="tribe-bar-submit"> <input class="tribe-events-button tribe-no-param" type="submit" name="submit-bar" value="<?php echo esc_attr(sprintf(__('Find %s', 'the-events-calendar'), tribe_get_event_label_plural())); ?> " /> </div> <!-- .tribe-bar-submit --> </div> <!-- .tribe-bar-filters-inner --> </div><!-- .tribe-bar-filters --> <?php } // if ( !empty( $filters ) ) ?> </form> <!-- #tribe-bar-form -->
/** * Sets an appropriate no results found message. This may be overridden in child classes. */ protected function nothing_found_notice() { $events_label_plural = strtolower(tribe_get_event_label_plural()); list($search_term, $tax_term, $geographic_term) = $this->get_search_terms(); $tribe = Tribe__Events__Main::instance(); if (!empty($search_term)) { Tribe__Events__Main::setNotice('event-search-no-results', sprintf(__('There were no results found for <strong>"%s"</strong>.', 'the-events-calendar'), esc_html($search_term))); } elseif (!empty($geographic_term)) { Tribe__Events__Main::setNotice('event-search-no-results', sprintf(__('No results were found for %1$s in or near <strong>"%2$s"</strong>.', 'the-events-calendar'), $events_label_plural, esc_html($geographic_term))); } elseif (!empty($tax_term) && tribe_is_upcoming() && date('Y-m-d') === date('Y-m-d', strtotime($tribe->date))) { Tribe__Events__Main::setNotice('events-not-found', sprintf(__('No upcoming %1$s listed under %2$s. Check out upcoming %3$s for this category or view the full calendar.', 'the-events-calendar'), $events_label_plural, $tax_term, $events_label_plural)); } elseif (!empty($tax_term) && tribe_is_upcoming()) { Tribe__Events__Main::setNotice('events-not-found', sprintf(__('No matching %1$s listed under %2$s. Please try viewing the full calendar for a complete list of %3$s.', 'the-events-calendar'), $events_label_plural, $tax_term, $events_label_plural)); } elseif (!empty($tax_term) && tribe_is_past()) { Tribe__Events__Main::setNotice('events-past-not-found', sprintf(__('No previous %s ', 'the-events-calendar'), $events_label_plural)); } elseif (!empty($tax_term)) { Tribe__Events__Main::setNotice('events-not-found', sprintf(__('No matching %1$s listed under %2$s. Please try viewing the full calendar for a complete list of %3$s.', 'the-events-calendar'), $events_label_plural, $tax_term, $events_label_plural)); } else { Tribe__Events__Main::setNotice('event-search-no-results', __('There were no results found.', 'the-events-calendar')); } }
public function filter_settings_tab_fields($fields, $tab) { $this->singular_event_label = tribe_get_event_label_singular(); $this->plural_event_label = tribe_get_event_label_plural(); switch ($tab) { case 'display': $fields = Tribe__Events__Main::array_insert_after_key('tribeDisableTribeBar', $fields, array('hideRelatedEvents' => array('type' => 'checkbox_bool', 'label' => __('Hide related events', 'tribe-events-calendar-pro'), 'tooltip' => __('Remove related events from the single event view', 'tribe-events-calendar-pro'), 'default' => false, 'validation_type' => 'boolean'))); $fields = Tribe__Events__Main::array_insert_after_key('monthAndYearFormat', $fields, array('weekDayFormat' => array('type' => 'text', 'label' => __('Week Day Format', 'tribe-events-calendar-pro'), 'tooltip' => __('Enter the format to use for week days. Used when showing days of the week in Week view.', 'tribe-events-calendar-pro'), 'default' => 'D jS', 'size' => 'medium', 'validation_type' => 'html'))); $fields = Tribe__Events__Main::array_insert_after_key('hideRelatedEvents', $fields, array('week_view_hide_weekends' => array('type' => 'checkbox_bool', 'label' => __('Hide weekends on Week View', 'tribe-events-calendar-pro'), 'tooltip' => __('Check this to only show weekdays on Week View', 'tribe-events-calendar-pro'), 'default' => false, 'validation_type' => 'boolean'))); break; } return $fields; }
echo esc_attr($filter['name']); ?> "><?php echo $filter['caption']; ?> </label> <?php echo $filter['html']; ?> </div> <?php } ?> <div class="tribe-bar-submit"> <input class="tribe-events-button tribe-no-param btn btn-sm" type="submit" name="submit-bar" value="<?php printf(__('Find %s', 'tribe-events-calendar'), tribe_get_event_label_plural()); ?> " /> </div> <!-- .tribe-bar-submit --> </div> <!-- .tribe-bar-filters-inner --> </div><!-- .tribe-bar-filters --> <?php } // if ( !empty( $filters ) ) ?> </form> <!-- #tribe-bar-form -->
/** * Sets an appropriate no results found message. * */ protected function nothing_found_notice() { if (!empty($this->args['suppress_nothing_found_notice'])) { return; } $events_label_plural = tribe_get_event_label_plural(); list($search_term, $tax_term, $geographic_term) = $this->get_search_terms(); if (!empty($search_term)) { Tribe__Notices::set_notice('event-search-no-results', sprintf(esc_html__('There were no results found for %s this month. Try searching next month.', 'the-events-calendar'), '<strong>"' . esc_html($search_term) . '"</strong>')); } elseif (!empty($tax_term)) { Tribe__Notices::set_notice('events-not-found', sprintf(esc_html__('No matching %1$s listed under %2$s. Please try viewing the full calendar for a complete list of events.', 'the-events-calendar'), strtolower($events_label_plural), $tax_term)); } else { Tribe__Notices::set_notice('event-search-no-results', esc_html__('There were no results found.', 'the-events-calendar')); } }
/** * Event Title * * Return an event's title with pseudo-breadcrumb if on a category * * @param bool $depth include linked title * * @return string title * @todo move logic to template classes */ function tribe_get_events_title($depth = true) { $events_label_plural = tribe_get_event_label_plural(); global $wp_query; $tribe_ecp = Tribe__Events__Main::instance(); $title = sprintf(esc_html__('Upcoming %s', 'the-events-calendar'), $events_label_plural); // If there's a date selected in the tribe bar, show the date range of the currently showing events if (isset($_REQUEST['tribe-bar-date']) && $wp_query->have_posts()) { $first_returned_date = tribe_get_start_date($wp_query->posts[0], false, Tribe__Date_Utils::DBDATEFORMAT); $first_event_date = tribe_get_start_date($wp_query->posts[0], false); $last_event_date = tribe_get_end_date($wp_query->posts[count($wp_query->posts) - 1], false); // If we are on page 1 then we may wish to use the *selected* start date in place of the // first returned event date if (1 == $wp_query->get('paged') && $_REQUEST['tribe-bar-date'] < $first_returned_date) { $first_event_date = tribe_format_date($_REQUEST['tribe-bar-date'], false); } $title = sprintf(__('%1$s for %2$s - %3$s', 'the-events-calendar'), $events_label_plural, $first_event_date, $last_event_date); } elseif (tribe_is_past()) { $title = sprintf(esc_html__('Past %s', 'the-events-calendar'), $events_label_plural); } if (tribe_is_month()) { $title = sprintf(esc_html__('%1$s for %2$s', 'the-events-calendar'), $events_label_plural, date_i18n(tribe_get_date_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date()))); } // day view title if (tribe_is_day()) { $title = sprintf(esc_html__('%1$s for %2$s', 'the-events-calendar'), $events_label_plural, date_i18n(tribe_get_date_format(true), strtotime($wp_query->get('start_date')))); } if (is_tax($tribe_ecp->get_event_taxonomy()) && $depth) { $cat = get_queried_object(); $title = '<a href="' . esc_url(tribe_get_events_link()) . '">' . $title . '</a>'; $title .= ' › ' . $cat->name; } return apply_filters('tribe_get_events_title', $title, $depth); }