Fix logic for when excluding a non-existant term. See #12891

git-svn-id: https://develop.svn.wordpress.org/trunk@16512 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
scribu
2010-11-20 21:28:50 +00:00
parent 75453e5e2d
commit a825250771
2 changed files with 15 additions and 14 deletions

View File

@@ -1947,12 +1947,8 @@ class WP_Query {
if ( !empty( $this->tax_query ) ) {
$clauses = call_user_func_array( 'get_tax_sql', array( $this->tax_query, $wpdb->posts, 'ID', &$this) );
if ( empty($clauses['join']) && empty($clauses['where']) ) {
$where .= ' AND 0 = 1';
} else {
$join .= $clauses['join'];
$where .= $clauses['where'];
}
$join .= $clauses['join'];
$where .= $clauses['where'];
if ( $this->is_tax ) {
if ( empty($post_type) ) {