apply_filters( 'editable_roles', array[] $all_roles )
Filters the list of editable roles.
Parameters
-
$all_roles
array[] -
Array of arrays containing role information.
More Information
editable_roles
is a filter applied by the function get_editable_roles() to the list of roles that one user can assign to others (a user must have the edit_users capability to change another user’s role). This list is displayed in the bulk operations (if the user has the list_users and promote_users) of the Users Screen, and on the profile screen.
Source
File: wp-admin/includes/user.php
.
View all references
$editable_roles = apply_filters( 'editable_roles', $all_roles );
Changelog
Version | Description |
---|---|
2.8.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Example migrated from Codex:
Filter out roles with levels higher than the current user’s:
Example migrated from Codex:
Add a “No role” option that sets users’ roles to nothing on pages other than the user profile screen (where it already exists):