WP_Roles::is_role() WordPress Method
The is_role() method is a static method of the WP_Roles class. This method can be used to check if a given role exists in the current WordPress installation.
WP_Roles::is_role( string $role ) #
Whether role name is currently in the list of available roles.
Contents
Parameters
- $role
(string)(Required)Role name to look up.
Return
(bool)
Source
File: wp-includes/class-wp-roles.php
public function is_role( $role ) { return isset( $this->role_names[ $role ] ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |