WP_Role::__construct( string $role, bool[] $capabilities )

Constructor – Set up object properties.

Description

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.

Parameters

$rolestringrequired
Role name.
$capabilitiesbool[]required
Array of key/value pairs where keys represent a capability name and boolean values represent whether the role has that capability.

Source

public function __construct( $role, $capabilities ) {
	$this->name         = $role;
	$this->capabilities = $capabilities;
}

Changelog

VersionDescription
2.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.