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
This commit is contained in:
ryan 2008-03-27 06:30:20 +00:00
parent 2b93618c82
commit a480e4e55b
1 changed files with 2 additions and 2 deletions

View File

@ -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']) )