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:
parent
dcbe9ba65d
commit
6423c620f8
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue