WordPress.org

Make WordPress Core

Changeset 15650


Ignore:
Timestamp:
09/23/10 23:19:47 (7 years ago)
Author:
scribu
Message:

Consistently set $post_type to 'any' when a taxonomy query is involved. See [15649]. See #14589

File:
1 edited

Legend:

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

    r15649 r15650  
    18301830                } 
    18311831            } 
    1832  
    1833             if ( empty($post_type) ) { 
    1834                 $post_type = 'any'; 
    1835                 $post_status_join = true; 
    1836             } elseif ( in_array('attachment', (array) $post_type) ) { 
    1837                 $post_status_join = true; 
    1838             } 
    18391832        } 
    18401833 
     
    19211914        if ( !empty( $tax_query ) ) { 
    19221915            $this->tax_query = $tax_query; 
     1916 
     1917            if ( empty($post_type) ) { 
     1918                $post_type = 'any'; 
     1919                $post_status_join = true; 
     1920            } elseif ( in_array('attachment', (array) $post_type) ) { 
     1921                $post_status_join = true; 
     1922            } 
    19231923 
    19241924            $where .= " AND $wpdb->posts.ID IN( " . implode( ', ', wp_tax_query( $tax_query ) ) . ")"; 
Note: See TracChangeset for help on using the changeset viewer.