From cb982c66acdb1ceb37b4a3dc2617d015e99ceb82 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 11 Sep 2013 00:09:10 +0000 Subject: [PATCH] Don't call `sanitize_title_with_dashes( $taxonomy )` in `register_taxonomy()` unless `$args['rewrite']['slug']` is empty. Props SergeyBiryukov. Fixes #23668. Built from https://develop.svn.wordpress.org/trunk@25335 git-svn-id: http://core.svn.wordpress.org/trunk@25297 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 6ddfeb00a2..fe30c82fa7 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -352,8 +352,9 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { } if ( false !== $args['rewrite'] && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) { + if ( empty( $args['rewrite']['slug'] ) ) + $args['rewrite']['slug'] = sanitize_title_with_dashes( $taxonomy ); $args['rewrite'] = wp_parse_args( $args['rewrite'], array( - 'slug' => sanitize_title_with_dashes( $taxonomy ), 'with_front' => true, 'hierarchical' => false, 'ep_mask' => EP_NONE,