apply_filters( 'user_has_cap', bool[] $allcaps , string[] $caps , array $args , WP_User $user )
Dynamically filter a user’s capabilities.
Parameters
- $allcaps
-
Array of key/value pairs where keys represent a capability name and boolean values represent whether the user has that capability.
- $caps
-
Required primitive capabilities for the requested capability.
- $args
-
Arguments that accompany the requested capability check.<br>
- (string) Requested capability.<br>
- '1'
(int) Concerned user ID.<br> - '...$2'
(mixed) Optional second and further parameters, typically object ID.<br>
- $user
-
The user object.
Source
Changelog
Version | Description |
---|---|
3.7.0 | Added the $user parameter. |
2.0.0 | Introduced. |