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

Constructor – Set up object properties.


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.


Top ↑

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 ).



Top ↑

Source Source

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

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

Top ↑

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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