editable_roles WordPress Filter Hook

The editable_roles hook allows you to modify the list of roles that are available for selection in the WordPress admin interface. This can be useful if you want to add or remove roles, or change the order in which they appear.

apply_filters( 'editable_roles', array[] $all_roles ) #

Filters the list of editable roles.


Parameters

$all_roles

(array[])Array of arrays containing role information.


Top ↑

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.


Top ↑

Source

File: wp-admin/includes/user.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.