Do not generate invalid SQL for empty term archives. See #12891
git-svn-id: http://svn.automattic.com/wordpress/trunk@15652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1380f38f95
commit
6dd01bf248
|
@ -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