From a480e4e55bd4d3f4a3a552849d9a430592852b6e Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 27 Mar 2008 06:30:20 +0000 Subject: [PATCH] Allow register_taxonomy() to be called before init for back compat with impatient plugins. git-svn-id: http://svn.automattic.com/wordpress/trunk@7545 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index a6ef8f054..09525aad8 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -158,14 +158,14 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { $defaults = array('hierarchical' => false, 'update_count_callback' => '', 'rewrite' => true, 'query_var' => true); $args = wp_parse_args($args, $defaults); - if ( false !== $args['query_var'] ) { + if ( false !== $args['query_var'] && !empty($wp) ) { if ( empty($args['query_var']) ) $args['query_var'] = $taxonomy; $args['query_var'] = sanitize_title_with_dashes($args['query_var']); $wp->add_query_var($args['query_var']); } - if ( false !== $args['rewrite'] ) { + if ( false !== $args['rewrite'] && !empty($wp_rewrite) ) { if ( !is_array($args['rewrite']) ) $args['rewrite'] = array(); if ( !isset($args['rewrite']['slug']) )