Consistently set $post_type to 'any' when a taxonomy query is involved. See [15649]. See #14589

git-svn-id: https://develop.svn.wordpress.org/trunk@15650 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
scribu 2010-09-23 23:19:47 +00:00
parent 9e37c78da3
commit d004c99ea6

View File

@ -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 ) ) . ")";
}