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
This commit is contained in:
nacin 2011-01-14 15:42:56 +00:00
parent dcbe9ba65d
commit 6423c620f8
1 changed files with 1 additions and 1 deletions

View File

@ -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;