Make WordPress Core

Ticket #23668: 23668.4.patch

File 23668.4.patch, 927 bytes (added by SergeyBiryukov, 12 years ago)
  • src/wp-includes/taxonomy.php

     
    352352        }
    353353
    354354        if ( false !== $args['rewrite'] && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) {
    355                 if ( ! is_array( $args['rewrite'] ) )
    356                         $args['rewrite'] = array();
     355                $args['rewrite'] = wp_parse_args( $args['rewrite'], array(
     356                        'with_front' => true,
     357                        'hierarchical' => false,
     358                        'ep_mask' => EP_NONE,
     359                ) );
    357360
    358361                if ( empty( $args['rewrite']['slug'] ) )
    359362                        $args['rewrite']['slug'] = sanitize_title_with_dashes( $taxonomy );
    360363
    361                 $args['rewrite'] = array_merge( array(
    362                         'with_front' => true,
    363                         'hierarchical' => false,
    364                         'ep_mask' => EP_NONE,
    365                 ), $args['rewrite'] );
    366 
    367364                if ( $args['hierarchical'] && $args['rewrite']['hierarchical'] )
    368365                        $tag = '(.+?)';
    369366                else