From d091e1d0b75c7e5f44b5a3c8dd5795fd91417f3a Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 11 Sep 2013 17:17:00 +0000 Subject: [PATCH] Avoid a notice by casting `$args['rewrite']` to `array()` before adding a `slug` property and running `array_merge()`. Fixes #23668. git-svn-id: https://develop.svn.wordpress.org/trunk@25351 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/taxonomy.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index fe30c82fa7..fe2bee4430 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -352,13 +352,17 @@ 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'] = wp_parse_args( $args['rewrite'], array( + + $args['rewrite'] = array_merge( array( 'with_front' => true, 'hierarchical' => false, 'ep_mask' => EP_NONE, - ) ); + ), $args['rewrite'] ); if ( $args['hierarchical'] && $args['rewrite']['hierarchical'] ) $tag = '(.+?)';