WordPress.org

Make WordPress Core

Changeset 10598


Ignore:
Timestamp:
02/19/2009 07:17:06 PM (9 years ago)
Author:
ryan
Message:

Use group by for meta key queries. Props filosofo. fixes #9167 for trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r10503 r10598  
    17911791
    17921792        if ( !empty($q['category__in']) ) {
    1793             $groupby = "{$wpdb->posts}.ID";
    1794         }
    1795 
    1796         if ( !empty($q['category__in']) ) {
    17971793            $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";
    17981794            $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'category' ";
     
    18701866        }
    18711867
    1872         if ( !empty($q['tag__in']) || !empty($q['tag_slug__in']) ) {
     1868        if ( !empty($q['category__in']) || !empty($q['meta_key']) || !empty($q['tag__in']) || !empty($q['tag_slug__in']) ) {
    18731869            $groupby = "{$wpdb->posts}.ID";
    18741870        }
Note: See TracChangeset for help on using the changeset viewer.