Wordpress 3.1.3
[autoinstalls/wordpress.git] / wp-includes / query.php
index ed08ebc450ec8be5bbebd8aa36aefad0487f8bfa..14942d94ec5af7c80dd19cf89cc8581e205385d5 100644 (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'] ) {