mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Do not generate invalid SQL for empty term archives. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@15652 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a59d598281
commit
b5f0bf47ac
@ -1921,7 +1921,11 @@ class WP_Query {
|
||||
$post_status_join = true;
|
||||
}
|
||||
|
||||
$where .= " AND $wpdb->posts.ID IN( " . implode( ', ', wp_tax_query( $tax_query ) ) . ")";
|
||||
$ids = wp_tax_query( $tax_query );
|
||||
if ( !empty($ids) )
|
||||
$where .= " AND $wpdb->posts.ID IN(" . implode( ', ', $ids ) . ")";
|
||||
else
|
||||
$where .= ' AND 0 = 1';
|
||||
}
|
||||
|
||||
if ( !empty($q['meta_key']) ) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user