W3cubDocs

/WordPress

WP_Roles::is_role( string $role )

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

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 ] );
	}

Changelog

Version Description
2.0.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_roles/is_role