Don't allow an empty rewrite slug for CPT. If you need something like this, do rewrite=>false. fixes #15082.

git-svn-id: https://develop.svn.wordpress.org/trunk@17298 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2011-01-14 15:42:56 +00:00
parent fa0584e236
commit b735118cd7
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;