WordPress.org

Make WordPress Core

Changeset 11141


Ignore:
Timestamp:
04/30/09 19:05:32 (5 years ago)
Author:
ryan
Message:

Fix registration of default taxonomies so that proper rewrite rules are written.

Location:
trunk/wp-includes
Files:
3 edited

Legend:

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

    r11109 r11141  
    254254 
    255255        foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) 
    256             if ( isset($t->query_var) ) 
     256            if ( $t->query_var ) 
    257257                $taxonomy_query_vars[$t->query_var] = $taxonomy; 
    258258 
  • trunk/wp-includes/query.php

    r11121 r11141  
    14001400                $this->is_tax = false; 
    14011401                foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) { 
    1402                     if ( isset($t->query_var) && isset($qv[$t->query_var]) && '' != $qv[$t->query_var] ) { 
     1402                    if ( $t->query_var && isset($qv[$t->query_var]) && '' != $qv[$t->query_var] ) { 
    14031403                        $qv['taxonomy'] = $taxonomy; 
    14041404                        $qv['term'] = $qv[$t->query_var]; 
     
    19391939            } else { 
    19401940                foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) { 
    1941                     if ( isset($t->query_var) && '' != $q[$t->query_var] ) { 
     1941                    if ( $t->query_var && '' != $q[$t->query_var] ) { 
    19421942                        $terms = get_terms($taxonomy, array('slug'=>$q[$t->query_var])); 
    19431943                        if ( !is_wp_error($terms) ) 
  • trunk/wp-includes/taxonomy.php

    r11140 r11141  
    1616 */ 
    1717function create_initial_taxonomies() { 
    18     register_taxonomy( 'category', 'post', array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories')) ) ;  
    19     register_taxonomy( 'post_tag', 'post', array('hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags')) ) ;  
    20     register_taxonomy( 'link_category', 'link', array('hierarchical' => false) ) ;  
     18    register_taxonomy( 'category', 'post', array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories'), 'query_var' => false, 'rewrite' => false) ) ;  
     19    register_taxonomy( 'post_tag', 'post', array('hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags'), 'query_var' => false, 'rewrite' => false) ) ;  
     20    register_taxonomy( 'link_category', 'link', array('hierarchical' => false, 'label' => __('Categories'), 'query_var' => false, 'rewrite' => false) ) ;  
    2121} 
    2222add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority 
Note: See TracChangeset for help on using the changeset viewer.