WordPress.org

Make WordPress Core

Changeset 7940


Ignore:
Timestamp:
05/16/08 02:35:24 (7 years ago)
Author:
matt
Message:

Fix default taxonomy query var. Populate taxonomy and term query vars ASAP. Fixes template fall-through. Hat tip: andy

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r7761 r7940  
    141141        $this->public_query_vars = apply_filters('query_vars', $this->public_query_vars); 
    142142 
     143        foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) 
     144            if ( isset($t->query_var) ) 
     145                $taxonomy_query_vars[$t->query_var] = $taxonomy; 
     146 
    143147        for ($i=0; $i<count($this->public_query_vars); $i += 1) { 
    144148            $wpvar = $this->public_query_vars[$i]; 
     
    154158                $this->query_vars[$wpvar] = $perma_query_vars[$wpvar]; 
    155159 
    156             if ( !empty( $this->query_vars[$wpvar] ) ) 
     160            if ( !empty( $this->query_vars[$wpvar] ) ) { 
    157161                $this->query_vars[$wpvar] = (string) $this->query_vars[$wpvar]; 
     162                if ( in_array( $wpvar, $taxonomy_query_vars ) ) { 
     163                    $this->query_vars['taxonomy'] = $taxonomy_query_vars[$wpvar]; 
     164                    $this->query_vars['term'] = $this->query_vars[$wpvar]; 
     165                } 
     166            } 
    158167        } 
    159168 
  • trunk/wp-includes/taxonomy.php

    r7939 r7940  
    160160 
    161161    if ( false !== $args['query_var'] && !empty($wp) ) { 
    162         if ( empty($args['query_var']) ) 
     162        if ( true === $args['query_var'] ) 
    163163            $args['query_var'] = $taxonomy; 
    164164        $args['query_var'] = sanitize_title_with_dashes($args['query_var']); 
Note: See TracChangeset for help on using the changeset viewer.