From 61cd7dffe02273dfded607fb6e357dec623b5869 Mon Sep 17 00:00:00 2001 From: scribu Date: Thu, 23 Sep 2010 23:11:49 +0000 Subject: [PATCH] Set $post_type to 'any' when taxonomies are involved (code resqued from r15613). See #12891 git-svn-id: http://svn.automattic.com/wordpress/trunk@15649 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wp-includes/query.php b/wp-includes/query.php index 5284e034ea..135dad69be 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1829,6 +1829,13 @@ 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