函数原型
get_editable_roles(): array[]
函数描述
Fetch a filtered list of user roles that the current user is allowed to edit.
是否弃用
未弃用
函数参数
无
函数返回值
array[] Array of arrays containing role information.
函数位置
File: wp-admin/includes/user.php.
函数源码
function get_editable_roles() {
$all_roles = wp_roles()->roles;
/**
* Filters the list of editable roles.
*
* @since 2.8.0
*
* @param array[] $all_roles Array of arrays containing role information.
*/
$editable_roles = apply_filters( 'editable_roles', $all_roles );
return $editable_roles;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |

