diff --git a/wp-includes/post.php b/wp-includes/post.php index 3d1227ff9a..1e5d3a27f0 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1342,9 +1342,9 @@ function register_post_type( $post_type, $args = array() ) { $post_type = sanitize_key( $post_type ); $args->name = $post_type; - if ( strlen( $post_type ) > 20 ) { - _doing_it_wrong( __FUNCTION__, __( 'Post types cannot exceed 20 characters in length' ), '4.0' ); - return new WP_Error( 'post_type_too_long', __( 'Post types cannot exceed 20 characters in length' ) ); + if ( empty( $post_type ) || strlen( $post_type ) > 20 ) { + _doing_it_wrong( __FUNCTION__, __( 'Post type names must be between 1 and 20 characters in length.' ), '4.2' ); + return new WP_Error( 'post_type_length_invalid', __( 'Post type names must be between 1 and 20 characters in length.' ) ); } // If not set, default to the setting for public. diff --git a/wp-includes/version.php b/wp-includes/version.php index 6802788ef2..d48b34f2c0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31449'; +$wp_version = '4.2-alpha-31450'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.