WordPress.org

Make WordPress Core

Changeset 21836


Ignore:
Timestamp:
09/13/12 17:15:13 (19 months ago)
Author:
nacin
Message:

Check that the taxonomy matches when calling is_tax() with only a taxonomy argument. props wonderboymusic, see #20590.

File:
1 edited

Legend:

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

    r21792 r21836  
    20452045        if ( '' !== $q['menu_order'] ) 
    20462046            $where .= " AND $wpdb->posts.menu_order = " . $q['menu_order']; 
    2047          
     2047 
    20482048        // If a month is specified in the querystring, load that month 
    20492049        if ( $q['m'] ) { 
     
    31933193        $term_array = (array) $term; 
    31943194 
    3195         if ( empty( $term ) ) // Only a Taxonomy provided 
    3196             return isset( $queried_object->taxonomy ) && count( $tax_array ) && in_array( $queried_object->taxonomy, $tax_array ); 
     3195        // Check that the taxonomy matches. 
     3196        if ( ! ( isset( $queried_object->taxonomy ) && count( $tax_array ) && in_array( $queried_object->taxonomy, $tax_array ) ) ) 
     3197            return false; 
     3198 
     3199        // Only a Taxonomy provided. 
     3200        if ( empty( $term ) ) 
     3201            return true; 
    31973202 
    31983203        return isset( $queried_object->term_id ) && 
Note: See TracChangeset for help on using the changeset viewer.