CB_Core_Role
in package
CB Core Roles Component
Helps manage roles and capabilities within the application.
Tags
Table of Contents
Properties
- $caps : array<string|int, mixed>
- The capabilities of the role.
- $id : string
- The role's id.
- $label : string
- The role's label.
Methods
- __construct() : mixed
- Construct a role.
- add_caps() : mixed
- Adds the given capabilities to the WP role.
- check_for_updates() : mixed
- Checks against WP roles to see if they need to be changed.
- remove_caps() : mixed
- Removes the given capabilities from the WP role.
- setup_actions() : mixed
- Adds an action to setup global values for roles.
- setup_globals() : mixed
- Maybe setup globals here?
Properties
$caps
The capabilities of the role.
public
array<string|int, mixed>
$caps
= []
$id
The role's id.
public
string
$id
$label
The role's label.
public
string
$label
= ''
Methods
__construct()
Construct a role.
public
__construct([string $id = '' ][, string $label = '' ][, array<string|int, mixed> $caps = [] ]) : mixed
Attempts to populate data when supplied with an id.
Parameters
- $id : string = ''
-
A text-based identifier for the role.
- $label : string = ''
-
A label for the role.
- $caps : array<string|int, mixed> = []
-
An array of key-value pairs of capabilities.
add_caps()
Adds the given capabilities to the WP role.
public
add_caps([array<string|int, mixed> $caps = [] ]) : mixed
Parameters
- $caps : array<string|int, mixed> = []
-
An array of key-value pairs of capabilities to add.
check_for_updates()
Checks against WP roles to see if they need to be changed.
public
check_for_updates() : mixed
remove_caps()
Removes the given capabilities from the WP role.
public
remove_caps([array<string|int, mixed> $caps = [] ]) : mixed
Parameters
- $caps : array<string|int, mixed> = []
-
An array of key-value pairs of capabilities to remove.
setup_actions()
Adds an action to setup global values for roles.
public
setup_actions() : mixed
setup_globals()
Maybe setup globals here?
public
setup_globals() : mixed