Make WordPress Core


Ignore:
Timestamp:
02/28/2012 08:29:33 PM (13 years ago)
Author:
duck_
Message:

Reduce references to the $wp_rewrite global because it's no longer used or a wrapper function can be used instead. Fixes #14546.#14546.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r19975 r20023  
    297297 * @since 2.3.0
    298298 * @uses $wp_taxonomies Inserts new taxonomy object into the list
    299  * @uses $wp_rewrite Adds rewrite tags and permastructs
    300299 * @uses $wp Adds query vars
    301300 *
     
    305304 */
    306305function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
    307     global $wp_taxonomies, $wp_rewrite, $wp;
     306    global $wp_taxonomies, $wp;
    308307
    309308    if ( ! is_array($wp_taxonomies) )
     
    344343            $tag = '([^/]+)';
    345344
    346         $wp_rewrite->add_rewrite_tag("%$taxonomy%", $tag, $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=");
    347         $wp_rewrite->add_permastruct( $taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite'] );
     345        add_rewrite_tag( "%$taxonomy%", $tag, $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=" );
     346        add_permastruct( $taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite'] );
    348347    }
    349348
Note: See TracChangeset for help on using the changeset viewer.