y_vars['meta_key'], array('_event_start', '_event_end', '_event_start_local', '_event_end_local')) ){ $wp_query->query_vars['meta_type'] = 'DATETIME'; } } $wp_query->query_vars['order'] = get_option('dbem_'. self::$option_name_plural .'_default_archive_order','ASC'); $post_types = $wp_query->get( 'post_type'); $post_types = is_array($post_types) ? $post_types + array(EM_POST_TYPE_EVENT) : EM_POST_TYPE_EVENT; if( !get_option('dbem_cp_events_search_results') ) $wp_query->set( 'post_type', $post_types ); //in case events aren't publicly searchable due to 'bug' in WP - https://core.trac.wordpress.org/ticket/17592 }elseif( !empty($wp_query->{'em_'.self::$option_name.'_id'}) ){ $post = $wp_query->post; } } public static function get_page_id(){ return get_option('dbem_'.self::$option_name_plural.'_page'); } public static function wpseo_breadcrumb_links( $links ){ global $wp_query; array_pop($links); if( self::get_page_id() ){ $links[] = array('id'=> self::get_page_id()); } $links[] = array('text'=> $wp_query->posts[0]->post_title); return $links; } /** * Switches the query back/forth from the original query if EM has interferred to add formatting for taxonomy pages. * Useful if you want plugins to temporarily access the old WP_Query which indicated we were looking at a taxonomy. * For example, with WordPress SEO by Yoast, for wpseo_head we can switch at priority 1 and switch back at a really low priority so meta data is correctly generated. * @param string $template * @return string */ public static function flip_the_query(){ global $wp_query, $wp_the_query, $em_the_query; if( !empty($em_the_query) ){ $old_query = $wp_the_query; $wp_query = $wp_the_query = $em_the_query; $em_the_query = $old_query; } } }