From 164be642a40e31d4418aa9e42804230ce462d1a4 Mon Sep 17 00:00:00 2001 From: scribu Date: Thu, 23 Sep 2010 23:19:47 +0000 Subject: [PATCH] Consistently set $post_type to 'any' when a taxonomy query is involved. See [15649]. See #14589 git-svn-id: http://svn.automattic.com/wordpress/trunk@15650 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 135dad69b..a4f6a0dd5 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1829,13 +1829,6 @@ class WP_Query { } } } - - if ( empty($post_type) ) { - $post_type = 'any'; - $post_status_join = true; - } elseif ( in_array('attachment', (array) $post_type) ) { - $post_status_join = true; - } } // Category stuff @@ -1921,6 +1914,13 @@ class WP_Query { if ( !empty( $tax_query ) ) { $this->tax_query = $tax_query; + if ( empty($post_type) ) { + $post_type = 'any'; + $post_status_join = true; + } elseif ( in_array('attachment', (array) $post_type) ) { + $post_status_join = true; + } + $where .= " AND $wpdb->posts.ID IN( " . implode( ', ', wp_tax_query( $tax_query ) ) . ")"; }