/** * Set up hooks for this template * * @return void * @since 3.0 **/ protected function hooks() { parent::hooks(); // Remove the comments template add_filter('comments_template', array($this, 'remove_comments_template')); add_action('tribe_events_single_organizer_before_upcoming_events', array($this, 'setup_upcoming_events')); add_filter('tribe_get_template_part_templates', array($this, 'remove_list_navigation'), 10, 3); }
/** * Setup meta display in this template * * @return void * @since 3.0 **/ public function setup_meta() { parent::setup_meta(); // setup the template for the meta group tribe_set_the_meta_template('tribe_event_venue', array('before' => '', 'after' => '', 'label_before' => '', 'label_after' => '', 'meta_before' => '<address class="venue-address">', 'meta_after' => '</address>'), 'meta_group'); // setup the template for the meta items tribe_set_the_meta_template(array('tribe_event_venue_address', 'tribe_event_venue_phone', 'tribe_event_venue_website'), array('before' => '', 'after' => '', 'label_before' => '', 'label_after' => '', 'meta_before' => '<span class="%s">', 'meta_after' => '</span>')); // turn off the venue name in the group tribe_set_the_meta_visibility('tribe_event_venue_name', false); // remove the title for the group & meta items tribe_set_meta_label('tribe_event_venue', '', 'meta_group'); tribe_set_meta_label(array('tribe_event_venue_address' => '', 'tribe_event_venue_phone' => '', 'tribe_event_venue_website' => '')); // set meta item priorities tribe_set_meta_priority(array('tribe_event_venue_address' => 10, 'tribe_event_venue_phone' => 20, 'tribe_event_venue_website' => 30)); add_filter('tribe_event_meta_venue_address_gmap', '__return_false'); // disable venue info from showing on list module (since it's duplicate of this view) tribe_set_the_meta_visibility('tribe_list_venue_name_address', false); }
/** * Set up the notices for this template * * @return void * @since 3.0 **/ public function set_notices() { parent::set_notices(); global $wp_query; // Look for a search query if (!empty($wp_query->query_vars['s'])) { $search_term = $wp_query->query_vars['s']; } else { if (!empty($_POST['tribe-bar-search'])) { $search_term = $_POST['tribe-bar-search']; } } // Search term based notices if (!empty($search_term) && !have_posts()) { TribeEvents::setNotice('event-search-no-results', sprintf(__('There were no results found for <strong>"%s"</strong> on this day. Try searching another day.', 'tribe-events-calendar-pro'), esc_html($search_term))); } else { if (empty($search_term) && empty($wp_query->query_vars['s']) && !have_posts()) { // Messages if currently no events, and no search term TribeEvents::setNotice('events-not-found', sprintf(__('No events scheduled for <strong>%s</strong>. Please try another day.', 'tribe-events-calendar-pro'), date_i18n('F d, Y', strtotime(get_query_var('eventDate'))))); } } }
/** * Add/remove filters to hide/show sensitive event info on password protected posts * * @param $post * @return void * @author Jessica Yazbek * @since 3.0 **/ public function manage_sensitive_info($post) { parent::manage_sensitive_info($post); if (post_password_required($post)) { add_filter('tribe_get_template_part_path_pro/week/single-event-tooltip.php', '__return_false'); } else { remove_filter('tribe_get_template_part_path_pro/week/single-event-tooltip.php', '__return_false'); } }
/** * Enqueue the proper styles depending on what is requred by a given page load. * * @return void * @author Jessica Yazbek * @since 3.0 */ public function enqueue_styles() { if (tribe_is_event_query() || is_active_widget(false, false, 'tribe-events-adv-list-widget') || is_active_widget(false, false, 'tribe-mini-calendar') || is_active_widget(false, false, 'tribe-events-countdown-widget') || is_active_widget(false, false, 'next_event') || is_active_widget(false, false, 'tribe-events-venue-widget')) { Tribe_PRO_Template_Factory::asset_package('events-pro-css'); } }
/** * Enqueue the maps JS in all the views (Needed for the location filter in the Tribe Bar) */ public function scripts() { if (tribe_is_event_query() && !is_single()) { Tribe_PRO_Template_Factory::asset_package('ajax-maps'); } }
protected function hooks() { parent::hooks(); add_filter('tribe_events_header_attributes', array($this, 'header_attributes')); }
/** * Add event classes specific to photo view * * @param $classes * @return array * @since 3.0 **/ public function event_classes($classes) { $classes = parent::event_classes($classes); $classes[] = 'tribe-events-photo-event'; return $classes; }
/** * Set up the notices for this template * * @return void * @since 3.0 **/ public function set_notices() { global $wp_query; $tribe = TribeEvents::instance(); $geographic_term = ''; $search_term = ''; $tax_term = ''; // No need to set notices unless we didn't find anything if (have_posts()) { return; } // Do we have a keyword or place name search? if (!empty($wp_query->query_vars['s'])) { $search_term = $wp_query->query_vars['s']; } elseif (!empty($_REQUEST['tribe-bar-search'])) { $search_term = $_REQUEST['tribe-bar-search']; } elseif (!empty($_REQUEST['tribe-bar-geoloc'])) { $geographic_term = $_REQUEST['tribe-bar-geoloc']; } if (is_tax($tribe->get_event_taxonomy())) { $tax_term = get_term_by('slug', get_query_var('term'), $tribe->get_event_taxonomy()); $tax_term = $tax_term->name; } // No events found on this day if (empty($search_term) && empty($geographic_term) && !empty($tax_term)) { TribeEvents::setNotice('events-not-found', sprintf(__('No matching events listed under %s scheduled for <strong>%s</strong>. Please try another day.', 'tribe-events-calendar-pro'), $tax_term, date_i18n(get_option('date_format'), strtotime(get_query_var('eventDate'))))); } elseif (empty($search_term) && empty($geographic_term)) { TribeEvents::setNotice('events-not-found', sprintf(__('No events scheduled for <strong>%s</strong>. Please try another day.', 'tribe-events-calendar-pro'), date_i18n(get_option('date_format'), strtotime(get_query_var('eventDate'))))); } else { parent::set_notices(); } }
/** * Set up hooks for map view * * @return void * @since 3.0 **/ protected function hooks() { parent::hooks(); add_filter('tribe_events_header_attributes', array($this, 'header_attributes')); add_action('tribe_events_list_before_the_event_title', array($this, 'add_event_distance')); }