role_has_cap WordPress Filter Hook
The role_has_cap hook is used to check if a user has a certain capability. This is useful for checking if a user is allowed to perform an action on your site.
apply_filters( 'role_has_cap', bool[] $capabilities , string $cap , string $name ) #
Filters which capabilities a role has.
Parameters
- $capabilities
(bool[])Array of key/value pairs where keys represent a capability name and boolean values represent whether the role has that capability.
- $cap
(string)Capability name.
- $name
(string)Role name.
Source
Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |