wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_ensure_editable_role › WordPress Function

Since6.8.0
Deprecatedn/a
wp_ensure_editable_role ( $role )
Parameters:
  • (string) $role Role the user is attempting to assign.
    Required: Yes
Defined at:
Codex:

Stop execution if the role can not be assigned by the current user.



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 );
	}
}