GB_User::has_cap
Whether user has capability or role name.
This is useful for looking up whether the user has a specific role assigned to the user. The second optional parameter can also be used to check for capabilities against a specific object, such as a post or user.
Signature
public function has_cap(string
$cap )
Parameters
$cap
— string
Capability or role name to search.
Returns
- bool
- True, if user has capability; false, if user does not have capability.
Violations
Checkstyle
Line | Column | Severity | Message |
---|---|---|---|
698 | 5 | error | Method name "GB_User::has_cap" is not in camel caps format |
698 | 5 | error | Visibility must be declared on method "has_cap" |
711 | 13 | error | Inline control structures are not allowed |