PHP Class WPDKUserRole

## Overview The WPDKUserRole is a new model for WordPress role object.
Since: 1.6.0
Author: =undo= ([email protected])
Inheritance: extends WP_Role
Show file Open project: wpxtreme/wpdk

Public Properties

Property Type Description
$description string Extended description for this role. This extra information is stored in the special array into the wp_options default database table.
$displayName string The display name of role
$owner Who create this role

Public Methods

Method Description
__construct ( string $role, string $display_name = '', array $capabilities = [], string $description = '', string $owner = '' ) : WPDKUserRole Create an instance of WPDKUserRoles class.
update ( ) : boolean Update the extra role information

Method Details

__construct() public method

If role already exists you get the role object, else you create (add) a new role. In this case you have to set display_name, description and capabilities.
public __construct ( string $role, string $display_name = '', array $capabilities = [], string $description = '', string $owner = '' ) : WPDKUserRole
$role string Role key
$display_name string Optional. Role display name. This param is optional because you coul read an exists role
$capabilities array Optional. List of any WPDKCapability or name of capability
$description string Optional. The extended description of this role
$owner string Optional. Owner of this role
return WPDKUserRole

update() public method

Update the extra role information
public update ( ) : boolean
return boolean

Property Details

$description public property

Extended description for this role. This extra information is stored in the special array into the wp_options default database table.
public string $description
return string

$displayName public property

The display name of role
public string $displayName
return string

$owner public property

Who create this role
public $owner