From 6df13c0a900c4b26dc2aedff86305ce2f887045a Mon Sep 17 00:00:00 2001 From: scribu Date: Mon, 22 Nov 2010 05:14:47 +0000 Subject: [PATCH] Consider only IN tax queries when returning the queried object. See #12891 git-svn-id: https://develop.svn.wordpress.org/trunk@16531 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index e8354592ea..1e25b9ae40 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2662,8 +2662,9 @@ class WP_Query { $this->queried_object = NULL; $this->queried_object_id = 0; - if ( !empty( $this->tax_query ) ) { - $query = reset( $this->tax_query ); + $tax_query_in = wp_list_filter( $this->tax_query, array( 'operator' => 'IN' ) ); + if ( !empty( $tax_query_in ) ) { + $query = reset( $tax_query_in ); if ( 'term_id' == $query['field'] ) $term = get_term( reset( $query['terms'] ), $query['taxonomy'] );