Don't set post_type to 'any' for category and tag queries. See #12891

git-svn-id: http://svn.automattic.com/wordpress/trunk@16505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-11-20 13:39:07 +00:00
parent 91a375041d
commit 7f59d20fb5
1 changed files with 9 additions and 5 deletions

View File

@ -1950,12 +1950,16 @@ class WP_Query {
$join .= $clauses['join']; $join .= $clauses['join'];
$where .= $clauses['where']; $where .= $clauses['where'];
debug($this->is_tax, $post_type);
if ( $this->is_tax ) {
if ( empty($post_type) ) { if ( empty($post_type) ) {
$post_type = 'any'; $post_type = 'any';
$post_status_join = true; $post_status_join = true;
} elseif ( in_array('attachment', (array) $post_type) ) { } elseif ( in_array('attachment', (array) $post_type) ) {
$post_status_join = true; $post_status_join = true;
} }
}
// Back-compat // Back-compat
$tax_query_in = wp_list_filter( $this->tax_query, array( 'operator' => 'IN' ) ); $tax_query_in = wp_list_filter( $this->tax_query, array( 'operator' => 'IN' ) );