Used By
| Used By | Description |
|---|---|
| wp-includes/class-wp-roles.php: WP_Roles::init_roles() | Initializes all of the available roles. |
| wp-includes/class-wp-roles.php: WP_Roles::add_role() | Add role name with capabilities to list. |
Constructor – Set up object properties.
The list of capabilities must have the key as the name of the capability and the value a boolean of whether it is granted to the role.
(string) (Required) Role name.
(bool[]) (Required) Array of key/value pairs where keys represent a capability name and boolean values represent whether the role has that capability.
File: wp-includes/class-wp-role.php
public function __construct( $role, $capabilities ) {
$this->name = $role;
$this->capabilities = $capabilities;
} | Version | Description |
|---|---|
| 2.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_role/__construct