WP_Role::__construct() public WP 2.0.0
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.
{} Это метод класса: WP_Role{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
global $wp_role; $wp_role->__construct( $role, $capabilities );
- $role(строка) (обязательный)
- Role name.
- $capabilities(true/false[]) (обязательный)
- Array of key/value pairs where keys represent a capability name and boolean values represent whether the role has that capability.
Список изменений
С версии 2.0.0 | Введена. |
Код WP_Role::__construct() WP Role:: construct WP 5.6.2
public function __construct( $role, $capabilities ) {
$this->name = $role;
$this->capabilities = $capabilities;
}