WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/17/2010 02:04:08 AM (9 years ago)
Author:
scribu
Message:

Re-introduce ->tax_query as a read-only var. See #12891

File:
1 edited

Legend:

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

    r16413 r16414  
    708708     */
    709709    var $query_vars = array();
     710
     711    /**
     712     * Taxonomy query, as passed to get_tax_sql()
     713     *
     714     * @since 3.1.0
     715     * @access public
     716     * @var array
     717     */
     718    var $tax_query = array();
    710719
    711720    /**
     
    19321941
    19331942        // Taxonomies
    1934         $q['tax_query'] = $this->parse_tax_query( $q );
    1935         if ( !empty( $q['tax_query'] ) ) {
    1936             $clauses = call_user_func_array( 'get_tax_sql', array( $q['tax_query'], $wpdb->posts, 'ID', &$this) );
     1943        $this->tax_query = $this->parse_tax_query( $q );
     1944        if ( !empty( $this->tax_query ) ) {
     1945            $clauses = call_user_func_array( 'get_tax_sql', array( $this->tax_query, $wpdb->posts, 'ID', &$this) );
    19371946
    19381947            $join .= $clauses['join'];
     
    19471956
    19481957            // Back-compat
    1949             $tax_query_in = wp_list_filter( $q['tax_query'], array( 'operator' => 'IN' ) );
     1958            $tax_query_in = wp_list_filter( $this->tax_query, array( 'operator' => 'IN' ) );
    19501959            if ( !empty( $tax_query_in ) ) {
    19511960                if ( !isset( $q['taxonomy'] ) ) {
     
    26472656        $this->queried_object_id = 0;
    26482657
    2649         $tax_query = $this->get('tax_query');
    2650 
    2651         if ( !empty( $tax_query ) ) {
    2652             $query = reset( $tax_query );
     2658        if ( !empty( $this->tax_query ) ) {
     2659            $query = reset( $this->tax_query );
    26532660
    26542661            if ( 'term_id' == $query['field'] )
Note: See TracChangeset for help on using the changeset viewer.