mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Text Changes: Unify permission error messages.
The new format looks like "Sorry, you are not allowed to <action>.". This provides a consistent experience for all error messages related to missing permissions. It also reduces the number of similar strings and allows translators to provide a consistent style in their language. Props ramiy, Presskopp. Fixes #34521. git-svn-id: https://develop.svn.wordpress.org/trunk@37914 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -110,11 +110,11 @@ case 'edit':
|
||||
wp_die( __( 'Unknown post type.' ) );
|
||||
|
||||
if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) {
|
||||
wp_die( __( 'You are not allowed to edit posts in this post type.' ) );
|
||||
wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
|
||||
}
|
||||
|
||||
if ( ! current_user_can( 'edit_post', $post_id ) )
|
||||
wp_die( __( 'You are not allowed to edit this item.' ) );
|
||||
wp_die( __( 'Sorry, you are not allowed to edit this item.' ) );
|
||||
|
||||
if ( 'trash' == $post->post_status )
|
||||
wp_die( __( 'You can’t edit this item because it is in the Trash. Please restore it and try again.' ) );
|
||||
@@ -211,7 +211,7 @@ case 'trash':
|
||||
wp_die( __( 'Unknown post type.' ) );
|
||||
|
||||
if ( ! current_user_can( 'delete_post', $post_id ) )
|
||||
wp_die( __( 'You are not allowed to move this item to the Trash.' ) );
|
||||
wp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) );
|
||||
|
||||
if ( $user_id = wp_check_post_lock( $post_id ) ) {
|
||||
$user = get_userdata( $user_id );
|
||||
@@ -234,7 +234,7 @@ case 'untrash':
|
||||
wp_die( __( 'Unknown post type.' ) );
|
||||
|
||||
if ( ! current_user_can( 'delete_post', $post_id ) )
|
||||
wp_die( __( 'You are not allowed to restore this item from the Trash.' ) );
|
||||
wp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) );
|
||||
|
||||
if ( ! wp_untrash_post( $post_id ) )
|
||||
wp_die( __( 'Error in restoring from Trash.' ) );
|
||||
@@ -252,7 +252,7 @@ case 'delete':
|
||||
wp_die( __( 'Unknown post type.' ) );
|
||||
|
||||
if ( ! current_user_can( 'delete_post', $post_id ) )
|
||||
wp_die( __( 'You are not allowed to delete this item.' ) );
|
||||
wp_die( __( 'Sorry, you are not allowed to delete this item.' ) );
|
||||
|
||||
if ( $post->post_type == 'attachment' ) {
|
||||
$force = ( ! MEDIA_TRASH );
|
||||
|
||||
Reference in New Issue
Block a user