WordPress at Your Fingertips
function is not described

WP_Roles::is_role() public WP 2.0.0

Whether role name is currently in the list of available roles.

{} It's a method of the class: WP_Roles{}

No Hooks.

Return

true|false.

Usage

global $wp_roles;
$wp_roles->is_role( $role );
$role(string) (required)
Role name to look up.

Changelog

Since 2.0.0 Introduced.

Code of WP_Roles::is_role() WP 5.8.2

public function is_role( $role ) {
	return isset( $this->role_names[ $role ] );
}