WPDK
1.5.0
WordPress Development Kit
|
Public Member Functions | |
get_cap ($cap_id) | |
Get a capability. More... | |
roleCapabilities () | |
Get all role capabilities. More... | |
userCapabilities () | |
Capability users. More... | |
allCapabilities () | |
All capabilities. More... | |
usersCapability () | |
User caps. More... | |
Static Public Member Functions | |
static | getInstance () |
Singleton instance of WPDKCapabilities. More... | |
static | defaultCapabilities () |
Get all standard WordPress capabilities list. More... | |
Data Fields | |
const | OPTION_KEY = '_wpdk_capabilities_extends' |
The option key prefix. More... | |
$roleCapabilities | |
All capabilities. More... | |
$defaultCapabilities | |
Only WordPress capabilities. More... | |
$capabilities | |
Only non-wordpress capabilities. More... | |
$userCapabilities | |
User capabiltity. More... | |
$allCapabilities | |
All capabilities. More... | |
A capabilities class model.
You have not confuse the property as roleCapabilities
by the method roleCapabilities()
. The properties are a linear array such array( cap1, cap2, ..., capn)
. The method instead return a key values pair array such array( cap1 => array( cap1, desc, owner), ... )
. The method return the extend information, the property only the name.
Definition at line 2237 of file wpdk-user.php.
allCapabilities | ( | ) |
All capabilities.
Return a key value pairs array with all registered capabilities.
[cap] = [cap, desc, owner]
Definition at line 2581 of file wpdk-user.php.
|
static |
Get all standard WordPress capabilities list.
Return a key value pairs array with unique id key of capability and the description as value. Make sure we keep the default capabilities in case users screw 'em up. A user could easily remove a useful WordPress capability from all roles. When this happens, the capability is no longer stored in any of the roles, so it basically doesn't exist. This function will house all of the default WordPress capabilities in case this scenario comes into play.
For those reading this note, yes, I did "accidentally" remove all capabilities from my administrator account when developing this plugin. And yes, that was fun putting back together.
The Codex has a list of all the defaults: http://codex.wordpress.org/Roles_and_Capabilities#Capabilities
Definition at line 2392 of file wpdk-user.php.
get_cap | ( | $cap_id | ) |
Get a capability.
Return an instance of WPDKCapability class or false if not exists
string | $cap_id | Capability id |
Definition at line 2358 of file wpdk-user.php.
|
static |
Singleton instance of WPDKCapabilities.
Return a singleton instance of WPDKCapabilities class
Definition at line 2309 of file wpdk-user.php.
roleCapabilities | ( | ) |
Get all role capabilities.
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.
Note that if no role has the capability, it technically no longer exists. Since this could be a problem with folks accidentally deleting the default WordPress capabilities, the members_default_capabilities() will return all the defaults.
[cap] = [cap, desc, owner]
Definition at line 2495 of file wpdk-user.php.
userCapabilities | ( | ) |
Capability users.
Return the capability added to user.
[cap] = [cap, desc, owner]
Definition at line 2541 of file wpdk-user.php.
usersCapability | ( | ) |
User caps.
Return a key value pairs array. For each user the list of its capabilties. This return array is used to hash from user id its capabilities.
[user_id] => [list of capabilities]
Definition at line 2609 of file wpdk-user.php.
array $allCapabilities |
array $capabilities |
Only non-wordpress capabilities.
This is the capabilities list without WordPress capabilties
Definition at line 2272 of file wpdk-user.php.
array $defaultCapabilities |
Only WordPress capabilities.
The standard WordPress capabilities list
Definition at line 2263 of file wpdk-user.php.
array $roleCapabilities |
array $userCapabilities |
User capabiltity.
The list of capabilities added to users
Definition at line 2281 of file wpdk-user.php.
const OPTION_KEY = '_wpdk_capabilities_extends' |
The option key prefix.
The extra data are save in option table with this prefix
Definition at line 2245 of file wpdk-user.php.