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"; }