Stop execution if the role can not be assigned by the current user.
Parameters
$role
stringrequired- Role the user is attempting to assign.
Source
function wp_ensure_editable_role( $role ) { $roles = get_editable_roles(); if ( ! isset( $roles[ $role ] ) ) { wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 ); } }
Changelog
Version | Description |
---|---|
6.8.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.