From 91812fa4a7750eca57c3e919b54ca4c49c381ceb Mon Sep 17 00:00:00 2001 From: scribu Date: Sun, 12 Dec 2010 16:38:51 +0000 Subject: [PATCH] Set $wp_query->tax_query earlier. See #15752 git-svn-id: http://svn.automattic.com/wordpress/trunk@16886 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 9c1c35d73..56e5b48a5 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1355,9 +1355,8 @@ class WP_Query { $this->is_date = true; } - $tax_query_obj = $this->parse_tax_query( $qv ); - - foreach ( $tax_query_obj->queries as $tax_query ) { + $this->parse_tax_query( $qv ); + foreach ( $this->tax_query->queries as $tax_query ) { if ( 'IN' == $tax_query['operator'] ) { switch ( $tax_query['taxonomy'] ) { case 'category': @@ -1371,8 +1370,7 @@ class WP_Query { } } } - - unset( $tax_query_obj, $tax_query ); + unset( $tax_query ); _parse_meta_query( $qv ); @@ -1494,7 +1492,6 @@ class WP_Query { * @since 3.1.0 * * @param array &$q The query variables - * @return WP_Tax_Query */ function parse_tax_query( &$q ) { if ( ! empty( $q['tax_query'] ) && is_array( $q['tax_query'] ) ) { @@ -1601,7 +1598,7 @@ class WP_Query { ); } - return new WP_Tax_Query( $tax_query ); + $this->tax_query = new WP_Tax_Query( $tax_query ); } /** @@ -1936,7 +1933,7 @@ class WP_Query { $search = apply_filters_ref_array('posts_search', array( $search, &$this ) ); // Taxonomies - $this->tax_query = $this->parse_tax_query( $q ); + $this->parse_tax_query( $q ); if ( $this->is_category || $this->is_tag || $this->is_tax ) { $clauses = $this->tax_query->get_sql( $wpdb->posts, 'ID' );