Make WordPress Core

Changeset 16893


Ignore:
Timestamp:
12/13/2010 03:11:02 PM (16 years ago)
Author:
scribu
Message:

Always call WP_Tax_Query::get_sql(). Fixes #15797

File:
1 edited

Legend:

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

    r16886 r16893  
    13571357
    13581358                        $this->parse_tax_query( $qv );
     1359
    13591360                        foreach ( $this->tax_query->queries as $tax_query ) {
    13601361                                if ( 'IN' == $tax_query['operator'] ) {
     
    19361937                $this->parse_tax_query( $q );
    19371938
     1939                $clauses = $this->tax_query->get_sql( $wpdb->posts, 'ID' );
     1940
     1941                $join .= $clauses['join'];
     1942                $where .= $clauses['where'];
     1943
     1944                if ( $this->is_tax ) {
     1945                        if ( empty($post_type) ) {
     1946                                $post_type = 'any';
     1947                                $post_status_join = true;
     1948                        } elseif ( in_array('attachment', (array) $post_type) ) {
     1949                                $post_status_join = true;
     1950                        }
     1951                }
     1952
     1953                // Back-compat
    19381954                if ( $this->is_category || $this->is_tag || $this->is_tax ) {
    1939                         $clauses = $this->tax_query->get_sql( $wpdb->posts, 'ID' );
    1940 
    1941                         $join .= $clauses['join'];
    1942                         $where .= $clauses['where'];
    1943 
    1944                         if ( $this->is_tax ) {
    1945                                 if ( empty($post_type) ) {
    1946                                         $post_type = 'any';
    1947                                         $post_status_join = true;
    1948                                 } elseif ( in_array('attachment', (array) $post_type) ) {
    1949                                         $post_status_join = true;
    1950                                 }
    1951                         }
    1952 
    1953                         // Back-compat
    19541955                        $tax_query_in = wp_list_filter( $this->tax_query->queries, array( 'operator' => 'IN' ) );
    19551956                        if ( !empty( $tax_query_in ) ) {
Note: See TracChangeset for help on using the changeset viewer.