Do not return duplicate posts for Meta Queries. Props Greuben. Fixes #17264 for 3.1

git-svn-id: https://develop.svn.wordpress.org/branches/3.1@17805 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2011-05-05 04:08:22 +00:00
parent ad77c266b9
commit b4d82f8dc8

View File

@ -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'] ) {