Make WordPress Core


Ignore:
Timestamp:
06/25/2017 06:45:33 PM (7 years ago)
Author:
johnbillion
Message:

Users: Use more appropriate HTTP status codes for errors relating to user management.

Also re-uses one error message string.

Props tuanmh

Fixes #40230

File:
1 edited

Legend:

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

    r40127 r40940  
    6060        $editable_roles = get_editable_roles();
    6161        if ( ! empty( $new_role ) && empty( $editable_roles[$new_role] ) )
    62             wp_die(__('You can’t give users that role.'));
     62            wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 );
    6363    }
    6464
Note: See TracChangeset for help on using the changeset viewer.