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:
dd32 2010-09-24 12:09:44 +00:00
parent 1380f38f95
commit 6dd01bf248
1 changed files with 5 additions and 1 deletions

View File

@ -1921,7 +1921,11 @@ class WP_Query {
$post_status_join = true; $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']) ) { if ( !empty($q['meta_key']) ) {