| [ Index ] |
PHP Cross Reference of WordPress |
[Source view] [Print] [Project Stats]
User API: WP_Role class
| File Size: | 103 lines (2 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
WP_Role:: (4 methods):
__construct()
add_cap()
remove_cap()
has_cap()
| __construct( $role, $capabilities ) X-Ref |
| Constructor - Set up object properties. 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. since: 2.0.0 param: string $role Role name. param: bool[] $capabilities Array of key/value pairs where keys represent a capability name and boolean values |
| add_cap( $cap, $grant = true ) X-Ref |
| Assign role a capability. since: 2.0.0 param: string $cap Capability name. param: bool $grant Whether role has capability privilege. |
| remove_cap( $cap ) X-Ref |
| Removes a capability from a role. since: 2.0.0 param: string $cap Capability name. |
| has_cap( $cap ) X-Ref |
| Determines whether the role has the given capability. return: bool Whether the role has the given capability. since: 2.0.0 param: string $cap Capability name. |
| Generated: Tue Dec 23 01:00:02 2025 | Cross-referenced by PHPXref 0.7.1 |