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.


Top ↑

Source

File: wp-includes/class-wp-role.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.