Posts, Post Types: Use an existing string for "Invalid post type" error message.

Props ramiy.
Fixes #39171.
Built from https://develop.svn.wordpress.org/trunk@39756


git-svn-id: http://core.svn.wordpress.org/trunk@39694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2017-01-10 02:40:42 +00:00
parent fd0564d2bc
commit 9234febe06
4 changed files with 7 additions and 7 deletions

View File

@@ -107,7 +107,7 @@ case 'edit':
wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) );
if ( ! $post_type_object )
wp_die( __( 'Unknown post type.' ) );
wp_die( __( 'Invalid post type.' ) );
if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) {
wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
@@ -208,7 +208,7 @@ case 'trash':
wp_die( __( 'The item you are trying to move to the Trash no longer exists.' ) );
if ( ! $post_type_object )
wp_die( __( 'Unknown post type.' ) );
wp_die( __( 'Invalid post type.' ) );
if ( ! current_user_can( 'delete_post', $post_id ) )
wp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) );
@@ -231,7 +231,7 @@ case 'untrash':
wp_die( __( 'The item you are trying to restore from the Trash no longer exists.' ) );
if ( ! $post_type_object )
wp_die( __( 'Unknown post type.' ) );
wp_die( __( 'Invalid post type.' ) );
if ( ! current_user_can( 'delete_post', $post_id ) )
wp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) );
@@ -249,7 +249,7 @@ case 'delete':
wp_die( __( 'This item has already been deleted.' ) );
if ( ! $post_type_object )
wp_die( __( 'Unknown post type.' ) );
wp_die( __( 'Invalid post type.' ) );
if ( ! current_user_can( 'delete_post', $post_id ) )
wp_die( __( 'Sorry, you are not allowed to delete this item.' ) );