WordPress.org

Make WordPress Core

Ticket #38804: 38804.patch

File 38804.patch, 2.5 KB (added by ramiy, 4 years ago)
  • wp-admin/users.php

     
    9494        check_admin_referer('bulk-users');
    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']) ) {
    100100                wp_redirect($redirect);
     
    110110        }
    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
    116116        $userids = $_REQUEST['users'];
     
    119119                $id = (int) $id;
    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')
    125125                        && ! ( is_multisite() && is_super_admin() ) ) {
     
    164164        }
    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';
    170170        $delete_count = 0;
     
    171171
    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 ) {
    177177                        $update = 'err_admin_del';
     
    204204        }
    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']) )
    210210                $userids = array( intval( $_REQUEST['user'] ) );
     
    314314        }
    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'];
    320320
     
    349349        }
    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']) )
    355355                $userids = array(intval($_REQUEST['user']));