Proper check for tax query, which will never be empty, due to 'relation'. See #15752

git-svn-id: http://svn.automattic.com/wordpress/trunk@16844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-12-09 17:09:42 +00:00
parent e11b831338
commit 905f5bf810
1 changed files with 35 additions and 37 deletions

View File

@ -1939,10 +1939,9 @@ class WP_Query {
$search = apply_filters_ref_array('posts_search', array( $search, &$this ) );
// Taxonomies
if ( !$this->is_singular ) {
if ( $this->is_category || $this->is_tag || $this->is_tax ) {
$this->tax_query = $this->parse_tax_query( $q );
if ( ! empty( $this->tax_query ) ) {
$clauses = call_user_func_array( 'get_tax_sql', array( $this->tax_query, $wpdb->posts, 'ID', &$this) );
$join .= $clauses['join'];
@ -1985,9 +1984,8 @@ class WP_Query {
}
}
}
}
if ( !empty( $this->tax_query ) || !empty( $q['meta_key'] ) ) {
if ( $this->is_category || $this->is_tag || $this->is_tax || !empty( $q['meta_key'] ) ) {
$groupby = "{$wpdb->posts}.ID";
}