Role_Handler implements Registerable, Standard_Service
Handles some technicalities around WP_Roles
Tags
Interfaces, Classes and Traits
- Registerable
- Standard_Service
Table of Contents
- editable_roles() : array<string|int, WP_Role>
- Removes pending role from add and edit user screens.
- handle_deleted_role() : array<string|int, mixed>
- Monitors if a role has been deleted.
- init() : void
- Initializes the Role Handler
- register() : mixed
- {@inheritdoc}
Methods
editable_roles()
Removes pending role from add and edit user screens.
public
editable_roles(array<string|int, WP_Role> $all_roles) : array<string|int, WP_Role>
Parameters
- $all_roles : array<string|int, WP_Role>
Tags
Return values
array<string|int, WP_Role> —$all_roles
handle_deleted_role()
Monitors if a role has been deleted.
public
handle_deleted_role(array<string|int, mixed> $value, array<string|int, mixed> $old_value) : array<string|int, mixed>
There is no WP filter/hook for this so we need to check pre_update_option
Parameters
- $value : array<string|int, mixed>
- $old_value : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —$value
init()
Initializes the Role Handler
public
init() : void
Tags
Return values
void —register()
{@inheritdoc}
public
register() : mixed