WP_Role::__construct()
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
. Ничего (null).
Использование
global $wp_role; $wp_role->__construct( $role, $capabilities );
- $role(строка) (обязательный)
- Role name.
- $capabilities(bool[]) (обязательный)
- 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 6.8
public function __construct( $role, $capabilities ) { $this->name = $role; $this->capabilities = $capabilities; }