프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$activeRoles | array | An array with all active roles | |
$all_roles | array | Array with the list of all roles. | |
$arrayCapabilitiesByRole | array | An key value pairs array with key = role and value = list of capabilities. | |
$arrayCountUsersByRole | array | List with count role group by user | |
$count | integer | Number of roles | |
$inactiveRoles | array | An array with all inactive roles | |
$wordPressRoles | array | Default WordPress roles |
메소드 | 설명 | |
---|---|---|
__construct ( ) : WPDKUserRoles | Create an instance of WPDKUserRoles class | |
activeRoles ( ) : array | ||
add_role ( string $role, string $display_name, array $capabilities = [], string $description = '', string $owner = '' ) : null | WP_Role | Updates the list of roles, if the role doesn't already exist. | |
arrayCapabilitiesByRole ( ) : array | Create An key value pairs array with key = role and value = list of capabilities. | |
countUsersByRole ( ) : array | Set the arrayCountUsersByRole property with the list of user count by role. | |
getInstance ( ) : WPDKUserRoles | Create a singleton instance of WPDKUserRoles class | |
get_instance ( ) : WPDKUserRoles | Create a singleton instance of WPDKUserRoles class | |
inactiveRoles ( ) : array | ||
init ( ) : WPDKUserRoles | Create a singleton instance of WPDKUserRoles class | |
invalidate ( ) : WPDKUserRoles | Used to invalidate static (internal singleton) and refresh all roles list | |
remove_role ( string $role ) | Remove a role | |
roleExists ( string $role ) : boolean | Return TRUE if the role exists | |
rolesWithCaps ( WPDKCapability | string | array $caps ) : array | Return the roles id list with one or more caps | |
statusRoles ( ) | Set the activeRoles and inactiveRoles properties array. | |
wordPressRoles ( ) : mixed | void | Return a key value pairs array with name of role and extends info. |
public __construct ( ) : WPDKUserRoles | ||
리턴 | WPDKUserRoles |
public add_role ( string $role, string $display_name, array $capabilities = [], string $description = '', string $owner = '' ) : null | WP_Role | ||
$role | string | Role name. |
$display_name | string | Role display name. |
$capabilities | array | Optional. List of role capabilities in the above format. |
$description | string | Optional. An extend description for this role. |
$owner | string | Optional. Owner of this role |
리턴 | null | WP_Role |
public arrayCapabilitiesByRole ( ) : array | ||
리턴 | array |
public countUsersByRole ( ) : array | ||
리턴 | array |
public static getInstance ( ) : WPDKUserRoles | ||
리턴 | WPDKUserRoles |
public static get_instance ( ) : WPDKUserRoles | ||
리턴 | WPDKUserRoles |
public static init ( ) : WPDKUserRoles | ||
리턴 | WPDKUserRoles |
public static invalidate ( ) : WPDKUserRoles | ||
리턴 | WPDKUserRoles |
public roleExists ( string $role ) : boolean | ||
$role | string | Role key name |
리턴 | boolean |
public wordPressRoles ( ) : mixed | void | ||
리턴 | mixed | void |
public array $arrayCapabilitiesByRole | ||
리턴 | array |
public array $arrayCountUsersByRole | ||
리턴 | array |