Skip to content

Commit

Permalink
Do not return duplicate posts for Meta Queries. Props Greuben. Fixes …
Browse files Browse the repository at this point in the history
…#17264 for 3.1

git-svn-id: http://svn.automattic.com/wordpress/branches/3.1@17805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
dd32 committed May 5, 2011
1 parent 61e239a commit 695d2fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wp-includes/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -2231,10 +2231,6 @@ function &get_posts() {
}
}

if ( !empty( $this->tax_query->queries ) || !empty( $q['meta_key'] ) ) {
$groupby = "{$wpdb->posts}.ID";
}

// Author/user stuff

if ( empty($q['author']) || ($q['author'] == '0') ) {
Expand Down Expand Up @@ -2480,6 +2476,10 @@ function &get_posts() {
$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'] ) {
Expand Down

0 comments on commit 695d2fa

Please sign in to comment.