function widget($args, $instance) { extract($args); extract($instance); if (empty($hide_if_empty)) { $hide_if_empty = false; } // Get all the upcoming events for this venue. $events = tribe_get_events(array('post_type' => TribeEvents::POSTTYPE, 'venue' => $venue_ID, 'posts_per_page' => $count, 'eventDisplay' => 'upcoming'), true); // If there are no events, and the user has set to hide if empty, don't display the widget. if ($hide_if_empty && !$events->have_posts()) { return; } $ecp = TribeEventsPro::instance(); $tooltip_status = $ecp->recurring_info_tooltip_status(); $ecp->disable_recurring_info_tooltip(); echo $before_widget; do_action('tribe_events_venue_widget_before_the_title'); echo $instance['title'] ? $args['before_title'] . $instance['title'] . $args['after_title'] : ''; do_action('tribe_events_venue_widget_after_the_title'); include TribeEventsTemplates::getTemplateHierarchy('pro/widgets/venue-widget.php'); echo $after_widget; if ($tooltip_status) { $ecp->enable_recurring_info_tooltip(); } wp_reset_postdata(); }
/** * Enqueue the appropriate CSS for the calendar/advanced list widgets, which share * the same basic appearance. */ public static function enqueue_calendar_widget_styles() { // CSS file $event_file = 'widget-calendar.css'; $event_file_option = 'widget-calendar-theme.css'; $stylesheet_option = tribe_get_option('stylesheetOption', 'tribe'); // Choose the appropriate stylesheet in light of the current styling options switch ($stylesheet_option) { case 'skeleton': case 'full': $event_file_option = "widget-calendar-{$stylesheet_option}.css"; break; } $style_url = TribeEventsPro::instance()->pluginUrl . 'resources/' . $event_file_option; $style_url = apply_filters('tribe_events_pro_widget_calendar_stylesheet_url', $style_url); $style_override_url = TribeEventsTemplates::locate_stylesheet('tribe-events/pro/' . $event_file, $style_url); // Load up stylesheet from theme or plugin if ($style_url && 'tribe' === $stylesheet_option) { wp_enqueue_style('widget-calendar-pro-style', TribeEventsPro::instance()->pluginUrl . 'resources/widget-calendar-full.css', array(), apply_filters('tribe_events_pro_css_version', TribeEventsPro::VERSION)); wp_enqueue_style(TribeEvents::POSTTYPE . '-widget-calendar-pro-style', $style_url, array(), apply_filters('tribe_events_pro_css_version', TribeEventsPro::VERSION)); } else { wp_enqueue_style(TribeEvents::POSTTYPE . '-widget-calendar-pro-style', $style_url, array(), apply_filters('tribe_events_pro_css_version', TribeEventsPro::VERSION)); } if ($style_override_url) { wp_enqueue_style(TribeEvents::POSTTYPE . '--widget-calendar-pro-override-style', $style_override_url, array(), apply_filters('tribe_events_pro_css_version', TribeEventsPro::VERSION)); } }
/** * Specify the template for agenda view * * @param $template string containing the current template file * @return string **/ function tribe_events_agenda_setup_view_template($template) { // agenda view if (tribe_is_agenda()) { $template = TribeEventsTemplates::getTemplateHierarchy('agenda'); } return $template; }
/** * Add the Tribe Bar to the tribe_events_before_html filter. * @param $content * * @filter tribe-events-bar-should-show set it to false to prevent infinite nesting * @filter tribe-events-bar-filters to get the list of registered filters * @filter tribe-events-bar-views to get the list of registered views * * To add filters: * * add_filter( 'tribe-events-bar-filters', 'setup_my_field_in_bar', 1, 1 ); * * public function setup_my_field_in_bar( $filters ) { * $filters[] = array( 'name' => 'tribe-bar-my-field', * 'caption' => 'My Field', * 'html' => '<input type="text" name="tribe-bar-my-field" id="tribe-bar-my-field">' ); * return $filters; * } * * To add views: * * add_filter( 'tribe-events-bar-views', 'my_setup_view_for_bar', 10); * * public function my_setup_view_for_bar( $views ) { * $tec = TribeEvents::instance(); * $views[] = array('displaying' => 'myview', 'anchor' => 'My view', 'url' => $tec->getOption( 'eventsSlug', 'events' ) . '/my_view_slug' ); * return $views; * } * * @return string */ public function show($content) { $tec = TribeEvents::instance(); //set it to false to prevent infinite nesting add_filter('tribe-events-bar-should-show', '__return_false', 9999); // Load the registered filters and views for the Bar. This values will be used in the template. $filters = apply_filters('tribe-events-bar-filters', self::instance()->filters); $views = apply_filters('tribe-events-bar-views', self::instance()->views); //Load the template ob_start(); include TribeEventsTemplates::getTemplateHierarchy('bar.php', array('subfolder' => 'modules')); $html = ob_get_clean() . $content; echo apply_filters('tribe_events_bar_show', $html, $filters, $views, $content); }
function get_output($event_ID, $complete, $show_seconds, $event_date = null) { $ret = $complete; ob_start(); include TribeEventsTemplates::getTemplateHierarchy('pro/widgets/countdown-widget'); $hourformat = ob_get_clean(); // Get the event start date. $startdate = tribe_is_recurring_event($event_ID) ? $event_date . ' ' . tribe_get_start_date($event_ID, false, TribeDateUtils::DBTIMEFORMAT) : tribe_get_start_date($event_ID, false, TribeDateUtils::DBDATETIMEFORMAT); // Get the number of seconds remaining until the date in question. $seconds = strtotime($startdate) - current_time('timestamp'); if ($seconds > 0) { $ret = $this->generate_countdown_output($seconds, $complete, $hourformat, $event_ID, $event_date); } return $ret; }
function widget($args, $instance) { extract($args); extract($instance); if (empty($hide_if_empty)) { $hide_if_empty = false; } // Get all the upcoming events for this venue. $events = tribe_get_events(array('post_type' => TribeEvents::POSTTYPE, 'meta_key' => '_EventVenueID', 'meta_value' => $venue_ID, 'posts_per_page' => $count, 'eventDisplay' => 'upcoming')); // If there are no events, and the user has set to hide if empty, don't display the widget. if ($hide_if_empty && empty($events)) { return; } echo $before_widget; $title = $before_title . apply_filters('widget_title', $title) . $after_title; include TribeEventsTemplates::getTemplateHierarchy('widgets/venue-widget.php'); echo $after_widget; }
function widget_output($args, $instance, $template_name = 'events-list-load-widget-display') { global $wp_query, $tribe_ecp, $post; extract($args, EXTR_SKIP); extract($instance, EXTR_SKIP); // extracting $instance provides $title, $limit $title = apply_filters('widget_title', $title); if (!isset($category)) { $category = null; } if (tribe_get_option('viewOption') == 'upcoming') { $event_url = tribe_get_listview_link($category != -1 ? intval($category) : null); } else { $event_url = tribe_get_gridview_link($category != -1 ? intval($category) : null); } if (function_exists('tribe_get_events')) { $posts = tribe_get_events('eventDisplay=upcoming&posts_per_page=' . $limit . '&eventCat=' . $category); $template = TribeEventsTemplates::getTemplateHierarchy($template_name); } // if no posts, and the don't show if no posts checked, let's bail if (!$posts && $no_upcoming_events) { return; } /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ echo $title ? $before_title . $title . $after_title : ''; if ($posts) { /* Display list of events. */ echo "<ul class='upcoming'>"; foreach ($posts as $post) { setup_postdata($post); include $template; } echo "</ul>"; /* Display link to all events */ echo '<div class="dig-in"><a href="' . $event_url . '">' . __('View All Events', 'tribe-events-calendar') . '</a></div>'; } else { _e('There are no upcoming events at this time.', 'tribe-events-calendar'); } /* After widget (defined by themes). */ echo $after_widget; wp_reset_query(); }
function widget($args, $instance) { global $wp_query, $post; $old_post = $post; extract($args, EXTR_SKIP); extract($instance, EXTR_SKIP); // extracting $instance provides $title, $limit, $no_upcoming_events, $start, $end, $venue, $address, $city, $state, $province'], $zip, $country, $phone , $cost $title = apply_filters('widget_title', $title); if (tribe_get_option('viewOption') == 'upcoming') { $event_url = tribe_get_listview_link(); } else { $event_url = tribe_get_gridview_link(); } if (function_exists('tribe_get_events')) { $posts = tribe_get_events('eventDisplay=upcoming&numResults=1&eventCat=' . $category); $template = TribeEventsTemplates::getTemplateHierarchy('widget-featured-display'); } // if no posts, and the don't show if no posts checked, let's bail if (!$posts && isset($no_upcoming_events) && $no_upcoming_events) { return; } /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ echo $title ? $before_title . $title . $after_title : ''; if ($posts) { /* Display list of events. */ foreach ($posts as $post) { setup_postdata($post); include $template; } } else { echo "<p>"; _e('There are no upcoming events at this time.', 'tribe-events-calendar-pro'); echo "</p>"; } /* After widget (defined by themes). */ echo $after_widget; $post = $old_post; }
/** * Asset calls for vendor packages * * @param string $name * @param array $deps Dependents */ public static function asset_package($name, $deps = array()) { $tec = TribeEvents::instance(); $prefix = 'tribe-events'; // TribeEvents::POSTTYPE; // setup plugin resources & 3rd party vendor urls $resources_url = trailingslashit($tec->pluginUrl) . 'resources/'; $vendor_url = trailingslashit($tec->pluginUrl) . 'vendor/'; switch ($name) { case 'jquery-resize': $path = self::getMinFile($vendor_url . 'jquery-resize/jquery.ba-resize.js', true); $deps = array_merge($deps, array('jquery')); wp_enqueue_script($prefix . '-jquery-resize', $path, $deps, '1.1', false); self::$vendor_scripts[] = $prefix . '-jquery-resize'; break; case 'chosen': // Vendor: jQuery Chosen $deps = array_merge($deps, array('jquery')); $css_path = self::getMinFile($vendor_url . 'chosen/public/chosen.css', true); $path = self::getMinFile($vendor_url . 'chosen/public/chosen.jquery.js', true); wp_enqueue_style($prefix . '-chosen-style', $css_path); wp_enqueue_script($prefix . '-chosen-jquery', $path, $deps, '0.9.5', false); self::$vendor_scripts[] = $prefix . '-chosen-jquery'; break; case 'smoothness': // Vendor: jQuery Custom Styles $path = self::getMinFile($vendor_url . 'jquery/smoothness/jquery-ui-1.8.23.custom.css', true); wp_enqueue_style($prefix . '-custom-jquery-styles', $path); break; case 'select2': // Vendor: Select2 $css_path = self::getMinFile($vendor_url . 'select2/select2.css', true); $path = self::getMinFile($vendor_url . 'select2/select2.js', true); wp_enqueue_style($prefix . '-select2-css', $css_path); wp_enqueue_script($prefix . '-select2', $path, 'jquery', '3.2'); self::$vendor_scripts[] = $prefix . '-select2'; break; case 'calendar-script': // Tribe Events JS $deps = array_merge($deps, array('jquery'), self::$vendor_scripts); $path = self::getMinFile($resources_url . 'tribe-events.js', true); wp_enqueue_script($prefix . '-calendar-script', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION)); break; case 'datepicker': // Vendor: jQuery Datepicker wp_enqueue_script('jquery-ui-datepicker'); wp_enqueue_style('jquery-ui-datepicker'); self::$vendor_scripts[] = 'jquery-ui-datepicker'; break; case 'bootstrap-datepicker': // Vendor: Bootstrap Datepicker $css_path = self::getMinFile($vendor_url . 'bootstrap-datepicker/css/datepicker.css', true); $path = self::getMinFile($vendor_url . 'bootstrap-datepicker/js/bootstrap-datepicker.js', true); wp_enqueue_style($prefix . '-bootstrap-datepicker-css', $css_path); wp_enqueue_script($prefix . '-bootstrap-datepicker', $path, 'jquery', '3.2'); self::$vendor_scripts[] = $prefix . '-bootstrap-datepicker'; $localized_datepicker_array = array('days' => array_merge($tec->daysOfWeek, array($tec->daysOfWeek[0])), 'daysShort' => array_merge($tec->daysOfWeekShort, array($tec->daysOfWeekShort[0])), 'daysMin' => array_merge($tec->daysOfWeekMin, array($tec->daysOfWeekMin[0])), 'months' => array_values($tec->monthsFull), 'monthsShort' => array_values($tec->monthsShort), 'clear' => 'Clear', 'today' => 'Today'); wp_localize_script($prefix . '-bootstrap-datepicker', 'tribe_bootstrap_datepicker_strings', array('dates' => $localized_datepicker_array)); break; case 'dialog': // Vendor: jQuery Dialog wp_enqueue_script('jquery-ui-dialog'); self::$vendor_scripts[] = 'jquery-ui-dialog'; break; case 'admin-ui': // Tribe Events $path = self::getMinFile($resources_url . 'events-admin.css', true); wp_enqueue_style($prefix . '-admin-ui', $path, array(), TribeEvents::VERSION); break; case 'admin': $deps = array_merge($deps, array('jquery', 'jquery-ui-datepicker')); $path = self::getMinFile($resources_url . 'events-admin.js', true); wp_enqueue_script($prefix . '-admin', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION), true); break; case 'settings': $deps = array_merge($deps, array('jquery')); $path = self::getMinFile($resources_url . 'tribe-settings.js', true); wp_enqueue_script($prefix . '-settings', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION), true); break; case 'ecp-plugins': $deps = array_merge($deps, array('jquery')); $path = self::getMinFile($resources_url . 'jquery-ecp-plugins.js', true); wp_enqueue_script($prefix . '-ecp-plugins', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION)); break; case 'tribe-events-bar': $deps = array_merge($deps, array('jquery', $prefix . '-calendar-script', $prefix . '-bootstrap-datepicker', $prefix . '-jquery-resize', self::get_placeholder_handle())); $path = self::getMinFile($resources_url . 'tribe-events-bar.js', true); wp_enqueue_script($prefix . '-bar', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION)); break; case 'jquery-placeholder': // Vendor: jQuery Placeholder $deps = array_merge($deps, array('jquery')); $path = self::getMinFile($vendor_url . 'jquery-placeholder/jquery.placeholder.js', true); $placeholder_handle = self::get_placeholder_handle(); wp_enqueue_script($placeholder_handle, $path, $deps, '2.0.7', false); self::$vendor_scripts[] = $placeholder_handle; break; case 'ajax-calendar': $deps = array_merge($deps, array('jquery', $prefix . '-bootstrap-datepicker', $prefix . '-calendar-script')); $ajax_data = array("ajaxurl" => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http')); $path = self::getMinFile($resources_url . 'tribe-events-ajax-calendar.js', true); wp_enqueue_script('tribe-events-calendar', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION), true); wp_localize_script('tribe-events-calendar', 'TribeCalendar', $ajax_data); break; case 'ajax-list': $deps = array_merge($deps, array('jquery', $prefix . '-calendar-script')); $tribe_paged = !empty($_REQUEST['tribe_paged']) ? $_REQUEST['tribe_paged'] : 0; $ajax_data = array("ajaxurl" => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'), 'tribe_paged' => $tribe_paged); $path = self::getMinFile($resources_url . 'tribe-events-ajax-list.js', true); wp_enqueue_script('tribe-events-list', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION), true); wp_localize_script('tribe-events-list', 'TribeList', $ajax_data); break; case 'events-css': // check if responsive should be killed if (apply_filters('tribe_events_kill_responsive', false)) { add_filter('tribe_events_mobile_breakpoint', '__return_zero'); } $stylesheets = array(); $mobile_break = tribe_get_mobile_breakpoint(); // Get the selected style option $style_option = tribe_get_option('stylesheetOption', 'tribe'); // Determine the stylesheet files for the selected option switch ($style_option) { case 'skeleton': $stylesheets['tribe-events-calendar-style'] = 'tribe-events-skeleton.css'; break; case 'full': $stylesheets['tribe-events-calendar-style'] = 'tribe-events-full.css'; if ($mobile_break > 0) { $stylesheets['tribe-events-calendar-mobile-style'] = 'tribe-events-full-mobile.css'; } break; default: // tribe styles $stylesheets['tribe-events-full-calendar-style'] = 'tribe-events-full.css'; $stylesheets['tribe-events-calendar-style'] = 'tribe-events-theme.css'; if ($mobile_break > 0) { $stylesheets['tribe-events-calendar-full-mobile-style'] = 'tribe-events-full-mobile.css'; $stylesheets['tribe-events-calendar-mobile-style'] = 'tribe-events-theme-mobile.css'; } break; } // put override css at the end of the array $stylesheets['tribe-events-calendar-override-style'] = 'tribe-events/tribe-events.css'; // do the enqueues foreach ($stylesheets as $name => $css_file) { if ($name == 'tribe-events-calendar-override-style') { $user_stylesheet_url = TribeEventsTemplates::locate_stylesheet('tribe-events/tribe-events.css'); if ($user_stylesheet_url) { wp_enqueue_style($name, $user_stylesheet_url); } } else { // get full URL $url = tribe_events_resource_url($css_file); // get the minified file $url = self::getMinFile($url, true); // apply filters $url = apply_filters('tribe_events_stylesheet_url', $url, $name); // set the $media attribute if ($name == 'tribe-events-calendar-mobile-style' || $name == 'tribe-events-calendar-full-mobile-style') { $media = "(max-width: {$mobile_break}px)"; wp_enqueue_style($name, $url, array('tribe-events-calendar-style'), TribeEvents::VERSION, $media); } else { wp_register_style($name, $url, array(), TribeEvents::VERSION); wp_enqueue_style($name); } } } break; default: do_action($prefix . '-' . $name); break; } }
/** * Enqueue the plugin stylesheet(s). * * @author PaulHughes01 * @since 3.4 * @return void */ function enqueueStylesAndScripts() { if (tribe_is_event_query() || tribe_is_event_organizer() || tribe_is_event_venue()) { $show_filter = apply_filters('tribe_events_filters_should_show', in_array(get_post_type(), array(TribeEvents::VENUE_POST_TYPE, TribeEvents::ORGANIZER_POST_TYPE)) ? false : true); if ($show_filter) { //Only display filters before template if the layout is horizontal if (tribe_get_option('events_filters_layout', 'vertical') == 'vertical') { add_action('tribe_events_bar_after_template', array($this, 'displaySidebar'), 25); } else { if (tribe_get_option('tribeDisableTribeBar', false) == true) { add_action('tribe_events_before_template', array($this, 'displaySidebar'), 25); } else { add_action('tribe_events_bar_after_template', array($this, 'displaySidebar'), 25); } } } // enqueue chosen for tag multi-select Tribe_Template_Factory::asset_package('chosen'); Tribe_Template_Factory::asset_package('calendar-script', array('jquery-ui-slider')); wp_enqueue_style('custom-jquery-styles'); wp_enqueue_style('TribeEventsFilterView-css', $this->pluginUrl . 'resources/filter-view.css', array(), apply_filters('tribe_events_filters_css_version', TribeEventsFilterView::VERSION)); wp_enqueue_script('jquery-ui-slider'); wp_enqueue_script('TribeEventsFilterView-scripts', $this->pluginUrl . 'resources/filter-scripts.js', array(), apply_filters('tribe_events_filters_js_version', TribeEventsFilterView::VERSION)); //Check for override stylesheet $user_stylesheet_url = TribeEventsTemplates::locate_stylesheet('tribe-events/filterbar/filter-view.css'); $user_stylesheet_url = apply_filters('tribe_events_filterbar_stylesheet_url', $user_stylesheet_url); //If override stylesheet exists, then enqueue it if ($user_stylesheet_url) { wp_enqueue_style('tribe-events-filterbar-override-style', $user_stylesheet_url); } } }
/** * The main widget output function (called by the class's widget() function). * * @param array $args * @param array $instance * @param string $template_name The template name. * @param string $subfolder The subfolder where the template can be found. * @param string $namespace The namespace for the widget template stuff. * @param string $pluginPath The pluginpath so we can locate the template stuff. */ function widget_output($args, $instance, $template_name = 'widgets/list-widget') { global $wp_query, $tribe_ecp, $post; $instance = wp_parse_args($instance, array('limit' => 5, 'title' => '')); /** * @var $after_title * @var $after_widget * @var $before_title * @var $before_widget * @var $limit * @var $no_upcoming_events * @var $title */ extract($args, EXTR_SKIP); extract($instance, EXTR_SKIP); // Temporarily unset the tribe bar params so they don't apply $hold_tribe_bar_args = array(); foreach ($_REQUEST as $key => $value) { if ($value && strpos($key, 'tribe-bar-') === 0) { $hold_tribe_bar_args[$key] = $value; unset($_REQUEST[$key]); } } $title = apply_filters('widget_title', $title); if (!function_exists('tribe_get_events')) { return; } $posts = tribe_get_events(apply_filters('tribe_events_list_widget_query_args', array('eventDisplay' => 'list', 'posts_per_page' => $limit))); // If no posts, and the don't show if no posts checked, let's bail if (!$posts && $no_upcoming_events) { return; } echo $before_widget; do_action('tribe_events_before_list_widget'); do_action('tribe_events_list_widget_before_the_title'); echo $title ? $before_title . $title . $after_title : ''; do_action('tribe_events_list_widget_after_the_title'); // Include template file include TribeEventsTemplates::getTemplateHierarchy($template_name); do_action('tribe_events_after_list_widget'); echo $after_widget; wp_reset_query(); // Reinstate the tribe bar params if (!empty($hold_tribe_bar_args)) { foreach ($hold_tribe_bar_args as $key => $value) { $_REQUEST[$key] = $value; } } }
/** * Load recurrence data for ECP. * * @param int $postId The event id. * @return void * @author Nick Ciske * @since 1.0 */ public function loadRecurrenceData($postId) { $context = $this->getContext(); $tribe_event_id = $context['id']; include TribeEventsTemplates::getTemplateHierarchy('community/modules/recurrence'); }
private function styles_and_scripts() { wp_enqueue_script('tribe-mini-calendar', TribeEventsPro::instance()->pluginUrl . 'resources/widget-calendar.js', array('jquery'), apply_filters('tribe_events_pro_js_version', TribeEventsPro::VERSION)); // Tribe Events CSS filename $event_file = 'widget-calendar.css'; $stylesheet_option = tribe_get_option('stylesheetOption', 'tribe'); // What Option was selected switch ($stylesheet_option) { case 'skeleton': $event_file_option = 'widget-calendar-' . $stylesheet_option . '.css'; break; case 'full': $event_file_option = 'widget-calendar-' . $stylesheet_option . '.css'; break; default: $event_file_option = 'widget-calendar-theme.css'; break; } $styleUrl = TribeEventsPro::instance()->pluginUrl . 'resources/' . $event_file_option; $styleUrl = apply_filters('tribe_events_pro_widget_calendar_stylesheet_url', $styleUrl); $styleOverrideUrl = TribeEventsTemplates::locate_stylesheet('tribe-events/pro/' . $event_file, $styleUrl); // Load up stylesheet from theme or plugin if ($styleUrl && $stylesheet_option == 'tribe') { wp_enqueue_style('widget-calendar-pro-style', TribeEventsPro::instance()->pluginUrl . 'resources/widget-calendar-full.css', array(), apply_filters('tribe_events_pro_css_version', TribeEventsPro::VERSION)); wp_enqueue_style(TribeEvents::POSTTYPE . '-widget-calendar-pro-style', $styleUrl, array(), apply_filters('tribe_events_pro_css_version', TribeEventsPro::VERSION)); } else { wp_enqueue_style(TribeEvents::POSTTYPE . '-widget-calendar-pro-style', $styleUrl, array(), apply_filters('tribe_events_pro_css_version', TribeEventsPro::VERSION)); } if ($styleOverrideUrl) { wp_enqueue_style(TribeEvents::POSTTYPE . '--widget-calendar-pro-override-style', $styleOverrideUrl, array(), apply_filters('tribe_events_pro_css_version', TribeEventsPro::VERSION)); } $widget_data = array("ajaxurl" => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http')); wp_localize_script('tribe-mini-calendar', 'TribeMiniCalendar', $widget_data); }
/** * Returns the full address of an event along with HTML markup. It * loads the full-address template to generate the HTML */ public function fullAddress($postId = null, $includeVenueName = false) { ob_start(); load_template(TribeEventsTemplates::getTemplateHierarchy('full-address'), false); $address = ob_get_contents(); ob_end_clean(); return $address; }
/** * Current Template * * Get the current page template that we are on * * @todo Update the function name to ensure there are no namespace conflicts. * @return string Page template */ function tribe_get_current_template() { return apply_filters('tribe_get_current_template', TribeEventsTemplates::get_current_page_template()); }
/** * The main widget output function (called by the class's widget() function). * * @param array $args * @param array $instance * @param string $template_name The template name. * @param string $subfolder The subfolder where the template can be found. * @param string $namespace The namespace for the widget template stuff. * @param string $pluginPath The pluginpath so we can locate the template stuff. */ function widget_output($args, $instance, $template_name = 'list-widget', $subfolder = 'widgets', $namespace = '/', $pluginPath = '') { global $wp_query, $tribe_ecp, $post; extract($args, EXTR_SKIP); // The view expects all these $instance variables, which may not be set without pro $instance = wp_parse_args($instance, array('limit' => 5, 'title' => '')); extract($instance, EXTR_SKIP); // extracting $instance provides $title, $limit $title = apply_filters('widget_title', $title); if (!isset($category) || $category === '-1') { $category = 0; } if (tribe_get_option('viewOption') == 'upcoming') { $event_url = tribe_get_listview_link($category); } else { $event_url = tribe_get_gridview_link($category); } if (function_exists('tribe_get_events')) { $args = array('eventDisplay' => 'upcoming', 'posts_per_page' => $limit); if (!empty($category)) { $args['tax_query'] = array(array('taxonomy' => TribeEvents::TAXONOMY, 'terms' => $category, 'field' => 'ID', 'include_children' => false)); } $posts = tribe_get_events($args); } // if no posts, and the don't show if no posts checked, let's bail if (!$posts && $no_upcoming_events) { return; } /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ echo $title ? $before_title . $title . $after_title : ''; if ($posts) { /* Display list of events. */ echo '<ol class="hfeed vcalendar">'; foreach ($posts as $post) { setup_postdata($post); include TribeEventsTemplates::getTemplateHierarchy('widgets/list-widget.php'); } echo "</ol><!-- .hfeed -->"; /* Display link to all events */ echo '<p class="tribe-events-widget-link"><a href="' . $event_url . '" rel="bookmark">' . __('View All Events', 'tribe-events-calendar') . '</a></p>'; } else { echo '<p>' . __('There are no upcoming events at this time.', 'tribe-events-calendar') . '</p>'; } /* After widget (defined by themes). */ echo $after_widget; wp_reset_query(); }
/** * Get the path to the current events template. * * @param string $template The current template path. * * @return string The modified template path. */ public function select_page_template($template) { // venue view if (is_singular(TribeEvents::VENUE_POST_TYPE)) { $template = TribeEventsTemplates::getTemplateHierarchy('pro/single-venue'); } // organizer view if (is_singular(TribeEvents::ORGANIZER_POST_TYPE)) { $template = TribeEventsTemplates::getTemplateHierarchy('pro/single-organizer'); } // week view if (tribe_is_week()) { $template = TribeEventsTemplates::getTemplateHierarchy('pro/week'); } // photo view if (tribe_is_photo()) { $template = TribeEventsTemplates::getTemplateHierarchy('pro/photo'); } // map view if (tribe_is_map()) { $template = TribeEventsTemplates::getTemplateHierarchy('pro/map'); } // recurring "all" view if (tribe_is_showing_all()) { $template = TribeEventsTemplates::getTemplateHierarchy('list'); // don't show pagination on the "all" view add_filter('tribe_get_template_part_path_list/nav.php', '__return_empty_string'); } return $template; }
/** * Get the path to the current events template. * * @param string $template The current template path. * @return string The modified template path. * @author Timothy Wood * @since 3.0 */ public function select_page_template($template) { // venue view if (is_singular(TribeEvents::VENUE_POST_TYPE)) { $template = TribeEventsTemplates::getTemplateHierarchy('pro/single-venue'); } // organizer view if (is_singular(TribeEvents::ORGANIZER_POST_TYPE)) { $template = TribeEventsTemplates::getTemplateHierarchy('pro/single-organizer'); } // week view if (tribe_is_week()) { $template = TribeEventsTemplates::getTemplateHierarchy('pro/week'); } // photo view if (tribe_is_photo()) { $template = TribeEventsTemplates::getTemplateHierarchy('pro/photo'); } // map view if (tribe_is_map()) { $template = TribeEventsTemplates::getTemplateHierarchy('pro/map'); } return $template; }
/** * Handles the "send to email" action for the attendees list. */ public function ajax_handler_attendee_mail_list() { if (!isset($_POST["event_id"]) || !isset($_POST["email"]) || !(is_numeric($_POST["email"]) || is_email($_POST["email"]))) { $this->ajax_error('Bad post'); } if (empty($_POST["nonce"]) || !wp_verify_nonce($_POST["nonce"], 'email-attendee-list') || !current_user_can('edit_tribe_events')) { $this->ajax_error('Cheatin Huh?'); } if (is_email($_POST["email"])) { $email = $_POST["email"]; } else { $user = get_user_by('id', $_POST["email"]); $email = $user->data->user_email; } if (empty($GLOBALS['hook_suffix'])) { $GLOBALS['hook_suffix'] = 'tribe_ajax'; } $this->attendees_page_screen_setup(); $items = $this->_generate_filtered_attendees_list($_POST["event_id"]); $event = get_post($_POST["event_id"]); ob_start(); $attendee_tpl = TribeEventsTemplates::getTemplateHierarchy('tickets/attendees-email.php', array('disable_view_check' => true)); include $attendee_tpl; $content = ob_get_clean(); add_filter('wp_mail_content_type', array($this, 'set_contenttype')); if (!wp_mail($email, sprintf(__('Attendee List for: %s', 'tribe-events-calendar'), $event->post_title), $content)) { $this->ajax_error('Error sending email'); } $this->ajax_ok(array()); }
/** * Calendar Mini Grid (Display) * * Displays the mini grid calendar table (usually in a widget) * * @uses load_template() * @since 2.0 */ function tribe_calendar_mini_grid() { set_query_var('eventDisplay', 'bydate'); load_template(TribeEventsTemplates::getTemplateHierarchy('table-mini')); }
/** * Generates and returns the email template for a group of attendees. * * @param $tickets * * @return string */ public function generate_tickets_email_content($tickets) { ob_start(); include TribeEventsTemplates::getTemplateHierarchy('email.php', array('subfolder' => 'tickets')); return ob_get_clean(); }
/** * The asset loading function. * * @param string $name The name of the package reqested. * @param array $deps An array of dependencies (this should be the registered name that is registered to the wp_enqueue functions). * * @return void */ public static function asset_package($name, $deps = array()) { $tec_pro = TribeEventsPro::instance(); $prefix = 'tribe-events-pro'; // setup plugin resources & 3rd party vendor urls $resources_url = trailingslashit($tec_pro->pluginUrl) . 'resources/'; $vendor_url = trailingslashit($tec_pro->pluginUrl) . 'vendor/'; switch ($name) { case 'ajax-weekview': $ajax_data = array("ajaxurl" => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'), 'post_type' => TribeEvents::POSTTYPE); $path1 = Tribe_Template_Factory::getMinFile($vendor_url . 'jquery-slimscroll/jquery.slimscroll.js', true); $path2 = Tribe_Template_Factory::getMinFile($resources_url . 'tribe-events-week.js', true); wp_enqueue_script('tribe-events-pro-slimscroll', $path1, array('tribe-events-pro', 'jquery-ui-draggable'), apply_filters('tribe_events_pro_js_version', TribeEventsPro::VERSION), true); wp_enqueue_script('tribe-events-pro-week', $path2, array('tribe-events-pro-slimscroll'), apply_filters('tribe_events_pro_js_version', TribeEventsPro::VERSION), true); wp_localize_script('tribe-events-pro-week', 'TribeWeek', $ajax_data); break; case 'ajax-photoview': $tribe_paged = !empty($_REQUEST['tribe_paged']) ? $_REQUEST['tribe_paged'] : 0; $ajax_data = array("ajaxurl" => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'), 'tribe_paged' => $tribe_paged); $path1 = Tribe_Template_Factory::getMinFile($vendor_url . 'isotope/jquery.isotope.js', true); $path2 = Tribe_Template_Factory::getMinFile($resources_url . 'tribe-events-photo-view.js', true); wp_enqueue_script('tribe-events-pro-isotope', $path1, array('tribe-events-pro'), apply_filters('tribe_events_pro_js_version', TribeEventsPro::VERSION), true); wp_enqueue_script('tribe-events-pro-photo', $path2, array('tribe-events-pro-isotope'), apply_filters('tribe_events_pro_js_version', TribeEventsPro::VERSION), true); wp_localize_script('tribe-events-pro-photo', 'TribePhoto', $ajax_data); break; case 'ajax-maps': $http = is_ssl() ? 'https' : 'http'; $url = apply_filters('tribe_events_pro_google_maps_api', $http . '://maps.google.com/maps/api/js?sensor=false'); wp_register_script('tribe-gmaps', $url, array('tribe-events-pro')); $path = Tribe_Template_Factory::getMinFile($resources_url . 'tribe-events-ajax-maps.js', true); wp_register_script('tribe-events-pro-geoloc', $path, array('tribe-gmaps', parent::get_placeholder_handle()), apply_filters('tribe_events_pro_js_version', TribeEventsPro::VERSION)); wp_enqueue_script('tribe-events-pro-geoloc'); $geoloc = TribeEventsGeoLoc::instance(); $data = array('ajaxurl' => admin_url('admin-ajax.php', $http), 'nonce' => wp_create_nonce('tribe_geosearch'), 'map_view' => TribeEvents::instance()->displaying == 'map' ? true : false); wp_localize_script('tribe-events-pro-geoloc', 'GeoLoc', $data); break; case 'events-pro-css': $stylesheets = array(); $mobile_break = tribe_get_mobile_breakpoint(); // Get the selected style option $style_option = tribe_get_option('stylesheetOption', 'tribe'); // Determine the stylesheet files for the selected option switch ($style_option) { case 'skeleton': $stylesheets['tribe-events-calendar-pro-style'] = 'tribe-events-pro-skeleton.css'; break; case 'full': $stylesheets['tribe-events-calendar-pro-style'] = 'tribe-events-pro-full.css'; if ($mobile_break > 0) { $stylesheets['tribe-events-calendar-pro-mobile-style'] = 'tribe-events-pro-full-mobile.css'; } break; default: // tribe styles $stylesheets['tribe-events-full-pro-calendar-style'] = 'tribe-events-pro-full.css'; $stylesheets['tribe-events-calendar-pro-style'] = 'tribe-events-pro-theme.css'; if ($mobile_break > 0) { $stylesheets['tribe-events-calendar-full-pro-mobile-style'] = 'tribe-events-pro-full-mobile.css'; $stylesheets['tribe-events-calendar-pro-mobile-style'] = 'tribe-events-pro-theme-mobile.css'; } break; } // put override css at the end of the array $stylesheets['tribe-events-calendar-pro-override-style'] = 'tribe-events/pro/tribe-events-pro.css'; // do the enqueues foreach ($stylesheets as $name => $css_file) { if ($name == 'tribe-events-calendar-pro-override-style') { $user_stylesheet_url = TribeEventsTemplates::locate_stylesheet($css_file); if ($user_stylesheet_url) { wp_enqueue_style($name, $user_stylesheet_url); } } else { // get full URL $url = tribe_events_pro_resource_url($css_file); // get the minified file $url = self::getMinFile($url, true); // apply filters $url = apply_filters('tribe_events_pro_stylesheet_url', $url, $name); // set the $media attribute if ($name == 'tribe-events-calendar-pro-mobile-style' || $name == 'tribe-events-calendar-full-pro-mobile-style') { $media = "only screen and (max-width: {$mobile_break}px)"; wp_enqueue_style($name, $url, array('tribe-events-calendar-pro-style'), TribeEventsPro::VERSION, $media); } else { wp_register_style($name, $url, array(), TribeEventsPro::VERSION); wp_enqueue_style($name); } } } break; } parent::asset_package($name, $deps); }
/** * 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 Events CSS filename $event_file = 'tribe-events-pro.css'; $stylesheet_option = tribe_get_option('stylesheetOption', 'tribe'); // What Option was selected switch ($stylesheet_option) { case 'skeleton': case 'full': $event_file_option = 'tribe-events-pro-' . $stylesheet_option . '.css'; break; default: $event_file_option = 'tribe-events-pro-theme.css'; break; } $styleUrl = trailingslashit($this->pluginUrl) . 'resources/' . $event_file_option; $styleUrl = apply_filters('tribe_events_pro_stylesheet_url', $styleUrl); // Is there a pro override file in the theme? $styleOverrideUrl = TribeEventsTemplates::locate_stylesheet('tribe-events/pro/' . $event_file, $styleUrl); // Load up stylesheet from theme or plugin if ($styleUrl && $stylesheet_option == 'tribe') { wp_enqueue_style('full-calendar-pro-style', trailingslashit($this->pluginUrl) . 'resources/tribe-events-pro-full.css'); wp_enqueue_style(TribeEvents::POSTTYPE . '-calendar-pro-style', $styleUrl); } else { wp_enqueue_style(TribeEvents::POSTTYPE . '-calendar-pro-style', $styleUrl); } if ($styleOverrideUrl) { wp_enqueue_style(TribeEvents::POSTTYPE . '-calendar-pro-override-style', $styleOverrideUrl); } } }
/** * Checks where we are are and determines if we should show events in the main loop * * @param WP_Query $query * @return WP_Query * @since 2.1 */ public static function showInLoops($query) { if (!is_admin() && tribe_get_option('showInLoops') && ($query->is_home() || $query->is_tag) && empty($query->query_vars['post_type']) && false == $query->query_vars['suppress_filters']) { // 3.3 know-how for main query check // if (method_exists($query, 'is_main_query')) { if (self::is_main_loop($query)) { self::$isMainLoop = true; $post_types = array('post', TribeEvents::POSTTYPE); $query->set('post_type', $post_types); } } return $query; }
public function select_venue_template($template) { return is_singular(TribeEvents::VENUE_POST_TYPE) ? TribeEventsTemplates::getTemplateHierarchy('single-venue') : $template; }
private static function spoofQuery() { global $wp_query, $withcomments; TribeEventsTemplates::$origPostCount = $wp_query->post_count; TribeEventsTemplates::$origCurrentPost = $wp_query->current_post; $wp_query->current_post = -1; $wp_query->post_count = 2; $wp_query->is_page = true; // don't show comments //$wp_query->is_single = false; // don't show comments $wp_query->is_singular = true; }
/** * Asset calls for vendor packages * * @param string $name * @param array $deps Dependents */ public static function asset_package($name, $deps = array()) { $tec = TribeEvents::instance(); $prefix = 'tribe-events'; // TribeEvents::POSTTYPE; // setup plugin resources & 3rd party vendor urls $resources_url = trailingslashit($tec->pluginUrl) . 'resources/'; $vendor_url = trailingslashit($tec->pluginUrl) . 'vendor/'; switch ($name) { case 'jquery-resize': $path = self::getMinFile($vendor_url . 'jquery-resize/jquery.ba-resize.js', true); $deps = array_merge($deps, array('jquery')); wp_enqueue_script($prefix . '-jquery-resize', $path, $deps, '1.1', false); self::$vendor_scripts[] = $prefix . '-jquery-resize'; break; case 'chosen': // Vendor: jQuery Chosen $deps = array_merge($deps, array('jquery')); $css_path = self::getMinFile($vendor_url . 'chosen/public/chosen.css', true); $path = self::getMinFile($vendor_url . 'chosen/public/chosen.jquery.js', true); wp_enqueue_style($prefix . '-chosen-style', $css_path); wp_enqueue_script($prefix . '-chosen-jquery', $path, $deps, '0.9.5', false); self::$vendor_scripts[] = $prefix . '-chosen-jquery'; break; case 'smoothness': // Vendor: jQuery Custom Styles $path = self::getMinFile($vendor_url . 'jquery/smoothness/jquery-ui-1.8.23.custom.css', true); wp_enqueue_style($prefix . '-custom-jquery-styles', $path); break; case 'select2': // Vendor: Select2 $css_path = self::getMinFile($vendor_url . 'select2/select2.css', true); $path = self::getMinFile($vendor_url . 'select2/select2.js', true); wp_enqueue_style($prefix . '-select2-css', $css_path); wp_enqueue_script($prefix . '-select2', $path, 'jquery', '3.2'); self::$vendor_scripts[] = $prefix . '-select2'; break; case 'calendar-script': // Tribe Events JS $deps = array_merge($deps, array('jquery'), self::$vendor_scripts); $path = self::getMinFile($resources_url . 'tribe-events.js', true); wp_enqueue_script($prefix . '-calendar-script', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION)); break; case 'datepicker': // Vendor: jQuery Datepicker wp_enqueue_script('jquery-ui-datepicker'); wp_enqueue_style('jquery-ui-datepicker'); self::$vendor_scripts[] = 'jquery-ui-datepicker'; break; case 'bootstrap-datepicker': // Vendor: Bootstrap Datepicker $css_path = self::getMinFile($vendor_url . 'bootstrap-datepicker/css/datepicker.css', true); $path = self::getMinFile($vendor_url . 'bootstrap-datepicker/js/bootstrap-datepicker.js', true); wp_enqueue_style($prefix . '-bootstrap-datepicker-css', $css_path); wp_enqueue_script($prefix . '-bootstrap-datepicker', $path, 'jquery', '3.2'); self::$vendor_scripts[] = $prefix . '-bootstrap-datepicker'; $localized_datepicker_array = array('days' => array_merge($tec->daysOfWeek, array($tec->daysOfWeek[0])), 'daysShort' => array_merge($tec->daysOfWeekShort, array($tec->daysOfWeekShort[0])), 'daysMin' => array_merge($tec->daysOfWeekMin, array($tec->daysOfWeekMin[0])), 'months' => array_values($tec->monthsFull), 'monthsShort' => array_values($tec->monthsShort)); wp_localize_script($prefix . '-bootstrap-datepicker', 'tribe_bootstrap_datepicker_strings', array('dates' => $localized_datepicker_array)); break; case 'dialog': // Vendor: jQuery Dialog wp_enqueue_script('jquery-ui-dialog'); self::$vendor_scripts[] = 'jquery-ui-dialog'; break; case 'admin-ui': // Tribe Events $path = self::getMinFile($resources_url . 'events-admin.css', true); wp_enqueue_style($prefix . '-admin-ui', $path); break; case 'admin': $deps = array_merge($deps, array('jquery', 'jquery-ui-datepicker')); $path = self::getMinFile($resources_url . 'events-admin.js', true); wp_enqueue_script($prefix . '-admin', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION), true); break; case 'settings': $deps = array_merge($deps, array('jquery')); $path = self::getMinFile($resources_url . 'tribe-settings.js', true); wp_enqueue_script($prefix . '-settings', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION), true); break; case 'ecp-plugins': $deps = array_merge($deps, array('jquery')); $path = self::getMinFile($resources_url . 'jquery-ecp-plugins.js', true); wp_enqueue_script($prefix . '-ecp-plugins', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION)); break; case 'tribe-events-bar': $deps = array_merge($deps, array('jquery', $prefix . '-calendar-script', $prefix . '-bootstrap-datepicker', $prefix . '-jquery-resize', $prefix . '-select2', 'tribe-placeholder')); $path = self::getMinFile($resources_url . 'tribe-events-bar.js', true); wp_enqueue_script($prefix . '-bar', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION)); break; case 'jquery-placeholder': // Vendor: jQuery Placeholder $deps = array_merge($deps, array('jquery')); $path = self::getMinFile($vendor_url . 'jquery-placeholder/jquery.placeholder.js', true); wp_enqueue_script('tribe-placeholder', $path, $deps, '2.0.7', false); self::$vendor_scripts[] = 'tribe-placeholder'; break; case 'ajax-calendar': $deps = array_merge($deps, array('jquery', $prefix . '-calendar-script')); $ajax_data = array("ajaxurl" => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http')); $path = self::getMinFile($resources_url . 'tribe-events-ajax-calendar.js', true); wp_enqueue_script('tribe-events-calendar', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION), true); wp_localize_script('tribe-events-calendar', 'TribeCalendar', $ajax_data); break; case 'ajax-list': $deps = array_merge($deps, array('jquery', $prefix . '-calendar-script')); $tribe_paged = !empty($_REQUEST['tribe_paged']) ? $_REQUEST['tribe_paged'] : 0; $ajax_data = array("ajaxurl" => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'), 'tribe_paged' => $tribe_paged); $path = self::getMinFile($resources_url . 'tribe-events-ajax-list.js', true); wp_enqueue_script('tribe-events-list', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION), true); wp_localize_script('tribe-events-list', 'TribeList', $ajax_data); break; case 'events-css': // Tribe Events CSS filename $event_file = 'tribe-events.css'; $stylesheet_option = tribe_get_option('stylesheetOption', 'tribe'); // What Option was selected switch ($stylesheet_option) { case 'skeleton': case 'full': $event_file_option = 'tribe-events-' . $stylesheet_option . '.css'; break; default: $event_file_option = 'tribe-events-theme.css'; break; } $styleUrl = trailingslashit($tec->pluginUrl) . 'resources/' . $event_file_option; $styleUrl = self::getMinFile($styleUrl, true); $styleUrl = apply_filters('tribe_events_stylesheet_url', $styleUrl); // Is there a core override file in the theme? $styleOverrideUrl = TribeEventsTemplates::locate_stylesheet('tribe-events/' . $event_file, $styleUrl); // Load up stylesheet from theme or plugin if ($styleUrl && $stylesheet_option == 'tribe') { $full_path = self::getMinFile(trailingslashit($tec->pluginUrl) . 'resources/tribe-events-full.css', true); wp_enqueue_style('full-calendar-style', $full_path); wp_enqueue_style(TribeEvents::POSTTYPE . '-calendar-style', $styleUrl); } else { wp_enqueue_style(TribeEvents::POSTTYPE . '-calendar-style', $styleUrl); } if ($styleOverrideUrl) { wp_enqueue_style(TribeEvents::POSTTYPE . '-calendar-override-style', $styleOverrideUrl); } break; default: do_action($prefix . '-' . $name); break; } }
private static function spoofQuery() { global $wp_query, $withcomments; TribeEventsTemplates::$origPostCount = $wp_query->post_count; TribeEventsTemplates::$origCurrentPost = $wp_query->current_post; $wp_query->current_post = -1; $wp_query->post_count = 2; $wp_query->is_page = true; // don't show comments //$wp_query->is_single = false; // don't show comments $wp_query->is_singular = true; if (empty($wp_query->posts)) { global $post; $spoofed_post = array("ID" => 1, "post_author" => 1, "post_date" => '1900-10-02 00:00:00', "post_date_gmt" => '1900-10-02 00:00:00', "post_content" => '', "post_title" => '', "post_excerpt" => '', "post_status" => 'publish', "comment_status" => 'closed', "ping_status" => 'closed', "post_password" => '', "post_name" => 'post', "to_ping" => '', "pinged" => '', "post_modified" => '1900-10-02 00:00:00', "post_modified_gmt" => '1900-10-02 00:00:00', "post_content_filtered" => '', "post_parent" => 0, "guid" => '', "menu_order" => 0, "post_type" => 'tribe_events', "post_mime_type" => '', "comment_count" => 0, "EventStartDate" => '1900-10-02 00:00:00', "EventEndDate" => '1900-10-02 00:00:00', "filter" => 'raw'); $post = (object) $spoofed_post; $wp_query->post = $post; $wp_query->posts[] = $post; $wp_query->posts[] = $post; } }