Consider only IN tax queries when returning the queried object. See #12891

git-svn-id: http://svn.automattic.com/wordpress/trunk@16531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-11-22 05:14:47 +00:00
parent 9a23bd6078
commit 06c1418787
1 changed files with 3 additions and 2 deletions

View File

@ -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'] );