X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f6364df6999f38896cc58171ec4a503f4f2dedcf..e9d988989fe37ab8c5f903e47fbe36e6e00dc51f:/wp-includes/query.php diff --git a/wp-includes/query.php b/wp-includes/query.php index ed08ebc4..14942d94 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2231,10 +2231,6 @@ class WP_Query { } } - if ( !empty( $this->tax_query->queries ) || !empty( $q['meta_key'] ) ) { - $groupby = "{$wpdb->posts}.ID"; - } - // Author/user stuff if ( empty($q['author']) || ($q['author'] == '0') ) { @@ -2480,6 +2476,10 @@ class WP_Query { $where .= $clauses['where']; } + if ( ! empty( $this->tax_query->queries ) || ! empty( $q['meta_query'] ) ) { + $groupby = "{$wpdb->posts}.ID"; + } + // Apply filters on where and join prior to paging so that any // manipulations to them are reflected in the paging by day queries. if ( !$q['suppress_filters'] ) {