Make WordPress Core


Ignore:
Timestamp:
06/29/2016 03:15:40 PM (8 years ago)
Author:
ocean90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/post.php

    r37424 r37914  
    111111
    112112    if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) {
    113         wp_die( __( 'You are not allowed to edit posts in this post type.' ) );
     113        wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
    114114    }
    115115
    116116    if ( ! current_user_can( 'edit_post', $post_id ) )
    117         wp_die( __( 'You are not allowed to edit this item.' ) );
     117        wp_die( __( 'Sorry, you are not allowed to edit this item.' ) );
    118118
    119119    if ( 'trash' == $post->post_status )
     
    212212
    213213    if ( ! current_user_can( 'delete_post', $post_id ) )
    214         wp_die( __( 'You are not allowed to move this item to the Trash.' ) );
     214        wp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) );
    215215
    216216    if ( $user_id = wp_check_post_lock( $post_id ) ) {
     
    235235
    236236    if ( ! current_user_can( 'delete_post', $post_id ) )
    237         wp_die( __( 'You are not allowed to restore this item from the Trash.' ) );
     237        wp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) );
    238238
    239239    if ( ! wp_untrash_post( $post_id ) )
     
    253253
    254254    if ( ! current_user_can( 'delete_post', $post_id ) )
    255         wp_die( __( 'You are not allowed to delete this item.' ) );
     255        wp_die( __( 'Sorry, you are not allowed to delete this item.' ) );
    256256
    257257    if ( $post->post_type == 'attachment' ) {
Note: See TracChangeset for help on using the changeset viewer.