From 90de63b3ad99865dfe42fceff0d86dd3489735a7 Mon Sep 17 00:00:00 2001 From: scribu Date: Fri, 19 Nov 2010 09:17:59 +0000 Subject: [PATCH] Force GROUP BY when there's a tax query. See #12891 git-svn-id: https://develop.svn.wordpress.org/trunk@16482 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 64fa8e3b82..205cd5f19d 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1984,7 +1984,7 @@ class WP_Query { } } - if ( !empty($q['meta_key']) ) { + if ( !empty( $this->tax_query ) || !empty( $q['meta_key'] ) ) { $groupby = "{$wpdb->posts}.ID"; }