WP_Role::has_cap

SummerySummery

Determines whether the role has the given capability.

Syntax

WP_Role::has_cap( string $cap )

DescriptionDescription

The capabilities is passed through the ‘role_has_cap’ filter. The first parameter for the hook is the list of capabilities the class has assigned. The second parameter is the capability name to look for. The third and final parameter for the hook is the role name.

ParametersParameters

$cap

(string) (Required) Capability name.

ReturnReturn

(bool) True if the role has the given capability. False otherwise.

SourceSource

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


			

ChangelogChangelog

Changelog
Version Description
2.0.0 Introduced.
Scroll to Top