From 8bb8033d6c3d6cf4131448df1e30db173b85ec2e Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@7545 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 a6ef8f054b..09525aad88 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']) )