From 6ea9e9692d795a23e4e647a732e01d938cbb1db5 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 18 Sep 2013 20:39:09 +0000 Subject: [PATCH] Use `wp_parse_args()` again for `$args['rewrite']` in `register_taxonomy()`. Props SergeyBiryukov. Fixes #23668. Built from https://develop.svn.wordpress.org/trunk@25483 git-svn-id: http://core.svn.wordpress.org/trunk@25404 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 44d9dfb476..676f059cf0 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -352,17 +352,14 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { } if ( false !== $args['rewrite'] && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) { - if ( ! is_array( $args['rewrite'] ) ) - $args['rewrite'] = array(); - - if ( empty( $args['rewrite']['slug'] ) ) - $args['rewrite']['slug'] = sanitize_title_with_dashes( $taxonomy ); - - $args['rewrite'] = array_merge( array( + $args['rewrite'] = wp_parse_args( $args['rewrite'], array( 'with_front' => true, 'hierarchical' => false, 'ep_mask' => EP_NONE, - ), $args['rewrite'] ); + ) ); + + if ( empty( $args['rewrite']['slug'] ) ) + $args['rewrite']['slug'] = sanitize_title_with_dashes( $taxonomy ); if ( $args['hierarchical'] && $args['rewrite']['hierarchical'] ) $tag = '(.+?)';