Appending to existing WP_Query’s meta_query if exists
You can use the WP_Query::get method to get whatever is in the meta query like this: add_action(‘pre_get_posts’,’add_another_meta_query’); function add_another_meta_query($query){ //Be sure to only use the main query on frontend if($query->is_main_query() && !is_admin()){ $meta_query = $query->get(‘meta_query’,array()); $new_meta_query = array(); //now, $meta_query has the meta_query if set (or an array) //check if the old version of meta_query … Read more