A WordPress-centric search engine for devs and theme authors



get_role ›

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:

Retrieve role object.



Source

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