Role_Handler implements Registerable, Standard_Service

Handles some technicalities around WP_Roles

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

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
Tags
Return values
mixed

Search results