Make WordPress Core

Changeset 16380


Ignore:
Timestamp:
11/15/2010 10:11:25 AM (16 years ago)
Author:
scribu
Message:

Re-parse tax query just before calling get_tax_sql(). Fixes #15161

File:
1 edited

Legend:

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

    r16360 r16380  
    14621462
    14631463        /*
    1464          * Populates the 'tax_query' property
     1464         * Parses various taxonomy related query vars and sets the appropriate query flags
    14651465         *
    14661466         * @access protected
    … …  
    14681468         *
    14691469         * @param array &$q The query variables
     1470         * @return array tax query
    14701471         */
    14711472        function parse_tax_query( &$q ) {
    … …  
    15811582                }
    15821583
    1583                 $q['tax_query'] = $tax_query;
    1584 
    1585                 foreach ( $q['tax_query'] as $query ) {
     1584                foreach ( $tax_query as $query ) {
    15861585                        if ( 'IN' == $query['operator'] ) {
    15871586                                switch ( $query['taxonomy'] ) {
    … …  
    15971596                        }
    15981597                }
     1598
     1599                return $tax_query;
    15991600        }
    16001601
    … …  
    19311932
    19321933                // Taxonomies
     1934                $q['tax_query'] = $this->parse_tax_query( $q );
    19331935                if ( !empty( $q['tax_query'] ) ) {
    19341936                        if ( empty($post_type) ) {
    … …  
    19421944
    19431945                        // Back-compat
    1944                         $cat_query = wp_list_filter( $q['tax_query'], array( 'taxonomy' => 'category' ) );
     1946                        $cat_query = wp_list_filter( $q['tax_query'], array( 'taxonomy' => 'category', 'operator' => 'IN' ) );
    19451947                        if ( !empty( $cat_query ) ) {
    19461948                                $cat_query = reset( $cat_query );
Note: See TracChangeset for help on using the changeset viewer.