From 30ee53dd96eac555faf44fa81d09b91ca3de9a67 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 30 Apr 2009 19:05:32 +0000 Subject: [PATCH] Fix registration of default taxonomies so that proper rewrite rules are written. git-svn-id: http://svn.automattic.com/wordpress/trunk@11141 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/classes.php | 2 +- wp-includes/query.php | 4 ++-- wp-includes/taxonomy.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-includes/classes.php b/wp-includes/classes.php index 73d2111670..9f4214c63e 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -253,7 +253,7 @@ class WP { $this->public_query_vars = apply_filters('query_vars', $this->public_query_vars); foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) - if ( isset($t->query_var) ) + if ( $t->query_var ) $taxonomy_query_vars[$t->query_var] = $taxonomy; for ($i=0; $ipublic_query_vars); $i += 1) { diff --git a/wp-includes/query.php b/wp-includes/query.php index 469b37c88d..154be7c9fe 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1399,7 +1399,7 @@ class WP_Query { if ( empty($qv['taxonomy']) || empty($qv['term']) ) { $this->is_tax = false; foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) { - if ( isset($t->query_var) && isset($qv[$t->query_var]) && '' != $qv[$t->query_var] ) { + if ( $t->query_var && isset($qv[$t->query_var]) && '' != $qv[$t->query_var] ) { $qv['taxonomy'] = $taxonomy; $qv['term'] = $qv[$t->query_var]; $this->is_tax = true; @@ -1938,7 +1938,7 @@ class WP_Query { $terms = get_terms($q['taxonomy'], array('slug'=>$q['term'])); } else { foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) { - if ( isset($t->query_var) && '' != $q[$t->query_var] ) { + if ( $t->query_var && '' != $q[$t->query_var] ) { $terms = get_terms($taxonomy, array('slug'=>$q[$t->query_var])); if ( !is_wp_error($terms) ) break; diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 068dae4ed1..662bfe4eb9 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -15,9 +15,9 @@ * Creates the initial taxonomies when 'init' action is fired. */ function create_initial_taxonomies() { - register_taxonomy( 'category', 'post', array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories')) ) ; - register_taxonomy( 'post_tag', 'post', array('hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags')) ) ; - register_taxonomy( 'link_category', 'link', array('hierarchical' => false) ) ; + register_taxonomy( 'category', 'post', array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories'), 'query_var' => false, 'rewrite' => false) ) ; + register_taxonomy( 'post_tag', 'post', array('hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags'), 'query_var' => false, 'rewrite' => false) ) ; + register_taxonomy( 'link_category', 'link', array('hierarchical' => false, 'label' => __('Categories'), 'query_var' => false, 'rewrite' => false) ) ; } add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority