From 602013831746f0a14f078ef51c221ea06eb53f27 Mon Sep 17 00:00:00 2001 From: scribu Date: Sat, 20 Nov 2010 13:39:07 +0000 Subject: [PATCH] Don't set post_type to 'any' for category and tag queries. See #12891 git-svn-id: https://develop.svn.wordpress.org/trunk@16505 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 8cc83a0ab6..d63d156223 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1950,11 +1950,15 @@ class WP_Query { $join .= $clauses['join']; $where .= $clauses['where']; - if ( empty($post_type) ) { - $post_type = 'any'; - $post_status_join = true; - } elseif ( in_array('attachment', (array) $post_type) ) { - $post_status_join = true; +debug($this->is_tax, $post_type); + + if ( $this->is_tax ) { + if ( empty($post_type) ) { + $post_type = 'any'; + $post_status_join = true; + } elseif ( in_array('attachment', (array) $post_type) ) { + $post_status_join = true; + } } // Back-compat