From 6423c620f898040802d7335b123c8d4f4a05fa01 Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 14 Jan 2011 15:42:56 +0000 Subject: [PATCH] Don't allow an empty rewrite slug for CPT. If you need something like this, do rewrite=>false. fixes #15082. git-svn-id: http://svn.automattic.com/wordpress/trunk@17298 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index eb26b8c82b..3c3759ee06 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -966,7 +966,7 @@ function register_post_type($post_type, $args = array()) { if ( false !== $args->rewrite && '' != get_option('permalink_structure') ) { if ( ! is_array( $args->rewrite ) ) $args->rewrite = array(); - if ( ! isset( $args->rewrite['slug'] ) ) + if ( empty( $args->rewrite['slug'] ) ) $args->rewrite['slug'] = $post_type; if ( ! isset( $args->rewrite['with_front'] ) ) $args->rewrite['with_front'] = true;