WP_Role::__construct

Advertisement

Summery Summery

Constructor – Set up object properties.

Syntax Syntax

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

Description 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 Parameters

$role

(string) (Required) Role name.

$capabilities

(bool[]) (Required) List of capabilities keyed by the capability name, e.g. array( 'edit_posts' => true, 'delete_posts' => false ).

Source Source

File: wp-includes/class-wp-role.php

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

Advertisement

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.