mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
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:
parent
e11b831338
commit
905f5bf810
@ -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";
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user