get_editable_roles

SummerySummery

Fetch a filtered list of user roles that the current user is allowed to edit.

Syntax

get_editable_roles()

DescriptionDescription

Simple function whose main purpose is to allow filtering of the list of roles in the $wp_roles object so that plugins can remove inappropriate ones depending on the situation or user making edits. Specifically because without filtering anyone with the edit_users capability can edit others to be administrators, even if they are only editors or authors. This filter allows admins to delegate user management.

ReturnReturn

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

SourceSource

File: wp-admin/includes/user.php


			

ChangelogChangelog

Changelog
Version Description
2.8.0 Introduced.
Scroll to Top