Make WordPress Core


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

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

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.