Property | Type | Description | |
---|---|---|---|
$allCapabilities | array | The list of all capabilities | |
$capabilities | array | This is the capabilities list without WordPress capabilties | |
$defaultCapabilities | array | The standard WordPress capabilities list | |
$roleCapabilities | array | All capabilities in all roles | |
$userCapabilities | array | The list of capabilities added to users |
Method | Description | |
---|---|---|
add_cap ( WPDKUserCapability $cap, array $roles = [], array $users = [] ) | Add a capability to roles and/or users | |
allCapabilities ( ) : array | Return a key value pairs array with all registered capabilities. | |
capabilityExists ( string $cap ) : boolean | Return TRUE if a capability exists | |
defaultCapabilities ( ) : array | Return a key value pairs array with unique id key of capability and the description as value. | |
delete ( string | array $id ) | Delete capabilities | |
delete_extended_data ( string | WPDKUserCapability $capability ) | Delete the capabilties extended data | |
getInstance ( ) : WPDKUserCapabilities | Return a singleton instance of WPDKUserCapabilities class | |
get_extended_data ( string | WPDKUserCapability $capability ) : boolean | Return the capabilties extended data or FALSE if not found. | |
init ( ) : WPDKUserCapabilities | Return a singleton instance of WPDKUserCapabilities class | |
roleCapabilities ( ) : array | Gets an array of capabilities according to each user role. Each role will return its caps, which are then added to the overall $capabilities array. | |
update_extended_data ( WPDKUserCapability $capability ) | Updated the capabilties extended data | |
userCapabilities ( ) : array | Return the capability added to user. | |
usersCapability ( ) : array | Return a key value pairs array. For each user the list of its capabilties. | |
usersWithCaps ( string | array $caps ) | Return a list of users id with any caps |
Method | Description | |
---|---|---|
__construct ( ) : WPDKUserCapabilities | Create an instance of WPDKUserCapabilities class | |
oldLevels ( ) : array | Return a key value pairs array with unique id key of capability and the description as value. |
public allCapabilities ( ) : array | ||
return | array |
public capabilityExists ( string $cap ) : boolean | ||
$cap | string | Capability ID |
return | boolean |
public static defaultCapabilities ( ) : array | ||
return | array | $defaults All the default WordPress capabilities. |
public delete_extended_data ( string | WPDKUserCapability $capability ) | ||
$capability | string | WPDKUserCapability | Any cap id or WPDKUserCapability istance |
public static getInstance ( ) : WPDKUserCapabilities | ||
return | WPDKUserCapabilities |
public get_extended_data ( string | WPDKUserCapability $capability ) : boolean | ||
$capability | string | WPDKUserCapability | Any cap id or WPDKUserCapability istance |
return | boolean |
public static init ( ) : WPDKUserCapabilities | ||
return | WPDKUserCapabilities |
public roleCapabilities ( ) : array | ||
return | array | $capabilities All the capabilities of all the user roles. |
public update_extended_data ( WPDKUserCapability $capability ) | ||
$capability | WPDKUserCapability | An instance of WPDKUserCapability class |
public userCapabilities ( ) : array | ||
return | array |
public usersCapability ( ) : array | ||
return | array |
public usersWithCaps ( string | array $caps ) | ||
$caps | string | array | Any single or array of caps |
public array $allCapabilities | ||
return | array |
public array $capabilities | ||
return | array |
public array $defaultCapabilities | ||
return | array |
public array $roleCapabilities | ||
return | array |
public array $userCapabilities | ||
return | array |