Dynamically filter a user’s capabilities.
$allcapsbool[]
$capsstring[]
$argsarray
0 string1 int...$2 mixed$userWP_User
Passing in a numeric value to WP_User::has_cap() object has been deprecated. Passing a numeric value will generate a deprecated option warning if debugging mode is enabled via wp_config.php:
Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.
This will occur if a plugin or a theme calls has_cap directly. The plugin or theme needs to be updated to use the new roles and capabilities classes.
$capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args, $this );
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/user_has_cap