WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/29/2016 03:15:40 PM (5 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/upload.php

    r36987 r37914  
    1111
    1212if ( !current_user_can('upload_files') )
    13     wp_die( __( 'You do not have permission to upload files.' ) );
     13    wp_die( __( 'Sorry, you are not allowed to upload files.' ) );
    1414
    1515$mode = get_user_option( 'media_library_mode', get_current_user_id() ) ? get_user_option( 'media_library_mode', get_current_user_id() ) : 'grid';
     
    133133            foreach ( (array) $post_ids as $post_id ) {
    134134                if ( !current_user_can( 'delete_post', $post_id ) )
    135                     wp_die( __( 'You are not allowed to move this item to the Trash.' ) );
     135                    wp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) );
    136136
    137137                if ( !wp_trash_post( $post_id ) )
     
    145145            foreach ( (array) $post_ids as $post_id ) {
    146146                if ( !current_user_can( 'delete_post', $post_id ) )
    147                     wp_die( __( 'You are not allowed to move this item out of the Trash.' ) );
     147                    wp_die( __( 'Sorry, you are not allowed to move this item out of the Trash.' ) );
    148148
    149149                if ( !wp_untrash_post( $post_id ) )
     
    157157            foreach ( (array) $post_ids as $post_id_del ) {
    158158                if ( !current_user_can( 'delete_post', $post_id_del ) )
    159                     wp_die( __( 'You are not allowed to delete this item.' ) );
     159                    wp_die( __( 'Sorry, you are not allowed to delete this item.' ) );
    160160
    161161                if ( !wp_delete_attachment( $post_id_del ) )
Note: See TracChangeset for help on using the changeset viewer.