mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-10 18:37:58 +01:00
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
This commit is contained in:
parent
61cd7dffe0
commit
164be642a4
@ -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
|
// Category stuff
|
||||||
@ -1921,6 +1914,13 @@ class WP_Query {
|
|||||||
if ( !empty( $tax_query ) ) {
|
if ( !empty( $tax_query ) ) {
|
||||||
$this->tax_query = $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 ) ) . ")";
|
$where .= " AND $wpdb->posts.ID IN( " . implode( ', ', wp_tax_query( $tax_query ) ) . ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user