Skip to content

Commit

Permalink
Allow register_taxonomy() to be called before init for back compat wi…
Browse files Browse the repository at this point in the history
…th impatient plugins.

git-svn-id: http://svn.automattic.com/wordpress/trunk@7545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
ryan committed Mar 27, 2008
1 parent 2b93618 commit a480e4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wp-includes/taxonomy.php
Expand Up @@ -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']) )
Expand Down

0 comments on commit a480e4e

Please sign in to comment.