WordPress at a glance

get_role() WP 1.0

Retrieve role object.

Works based on: wp_roles(), WP_Roles()
✈ 1 time = 0.000068s = very fast | 50000 times = 2.29s = fast

No Hooks.


WP_Role/null. WP_Role object if found, null if the role does not exist.


get_role( $role );
$role(string) (required)
Role name.

Code of get role: wp-includes/capabilities.php VER 5.1.1

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

Related Functions

From tag: Roles capabilities

No comments
    Hello, !     Log In . Register