Make WordPress Core


Ignore:
Timestamp:
11/15/2016 10:24:30 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Text Changes: Unify permission error messages in wp-admin/users.php.

Props ramiy.
Fixes #38804.

File:
1 edited

Legend:

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

    r38958 r39258  
    9595
    9696    if ( ! current_user_can( 'promote_users' ) )
    97         wp_die( __( 'You can’t edit that user.' ) );
     97        wp_die( __( 'Sorry, you are not allowed to edit that user.' ) );
    9898
    9999    if ( empty($_REQUEST['users']) ) {
     
    111111
    112112    if ( ! $role || empty( $editable_roles[ $role ] ) ) {
    113         wp_die( __( 'You can’t give users that role.' ) );
     113        wp_die( __( 'Sorry, you are not allowed to give users that role.' ) );
    114114    }
    115115
     
    120120
    121121        if ( ! current_user_can('promote_user', $id) )
    122             wp_die(__('You can’t edit that user.'));
     122            wp_die(__('Sorry, you are not allowed to edit that user.'));
    123123        // The new role of the current user must also have the promote_users cap or be a multisite super admin
    124124        if ( $id == $current_user->ID && ! $wp_roles->role_objects[ $role ]->has_cap('promote_users')
     
    165165
    166166    if ( ! current_user_can( 'delete_users' ) )
    167         wp_die(__('You can’t delete users.'));
     167        wp_die(__('Sorry, you are not allowed to delete users.'));
    168168
    169169    $update = 'del';
     
    172172    foreach ( $userids as $id ) {
    173173        if ( ! current_user_can( 'delete_user', $id ) )
    174             wp_die(__( 'You can’t delete that user.' ) );
     174            wp_die(__( 'Sorry, you are not allowed to delete that user.' ) );
    175175
    176176        if ( $id == $current_user->ID ) {
     
    205205
    206206    if ( ! current_user_can( 'delete_users' ) )
    207         $errors = new WP_Error( 'edit_users', __( 'You can’t delete users.' ) );
     207        $errors = new WP_Error( 'edit_users', __( 'Sorry, you are not allowed to delete users.' ) );
    208208
    209209    if ( empty($_REQUEST['users']) )
     
    315315
    316316    if ( ! current_user_can( 'remove_users' ) )
    317         wp_die( __( 'You can’t remove users.' ) );
     317        wp_die( __( 'Sorry, you are not allowed to remove users.' ) );
    318318
    319319    $userids = $_REQUEST['users'];
     
    350350
    351351    if ( !current_user_can('remove_users') )
    352         $error = new WP_Error('edit_users', __('You can’t remove users.'));
     352        $error = new WP_Error('edit_users', __('Sorry, you are not allowed to remove users.'));
    353353
    354354    if ( empty($_REQUEST['users']) )
Note: See TracChangeset for help on using the changeset viewer.