wpseek.com
A WordPress-centric search engine for devs and theme authors



get_role › WordPress Function

Since2.0.0
Deprecatedn/a
get_role ( $role )
Parameters:
  • (string) $role Role name.
    Required: Yes
Returns:
  • (WP_Role|null) WP_Role object if found, null if the role does not exist.
Defined at:
Codex:

Retrieves role object.



Source

function get_role( $role ) {
	return wp_roles()->get_role( $role );
}