Make WordPress Core

Changeset 25483


Ignore:
Timestamp:
09/18/2013 08:38:53 PM (11 years ago)
Author:
wonderboymusic
Message:

Use wp_parse_args() again for $args['rewrite'] in register_taxonomy().

Props SergeyBiryukov.
Fixes #23668.

File:
1 edited

Legend:

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

    r25384 r25483  
    353353
    354354    if ( false !== $args['rewrite'] && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) {
    355         if ( ! is_array( $args['rewrite'] ) )
    356             $args['rewrite'] = array();
    357 
    358         if ( empty( $args['rewrite']['slug'] ) )
    359             $args['rewrite']['slug'] = sanitize_title_with_dashes( $taxonomy );
    360 
    361         $args['rewrite'] = array_merge( array(
     355        $args['rewrite'] = wp_parse_args( $args['rewrite'], array(
    362356            'with_front' => true,
    363357            'hierarchical' => false,
    364358            'ep_mask' => EP_NONE,
    365         ), $args['rewrite'] );
     359        ) );
     360
     361        if ( empty( $args['rewrite']['slug'] ) )
     362            $args['rewrite']['slug'] = sanitize_title_with_dashes( $taxonomy );
    366363
    367364        if ( $args['hierarchical'] && $args['rewrite']['hierarchical'] )
Note: See TracChangeset for help on using the changeset viewer.