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.
$rolestringrequired
$capabilitiesbool[]required
public function __construct( $role, $capabilities ) {
$this->name = $role;
$this->capabilities = $capabilities;
}
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_role/__construct