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.

Return

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

Usage

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

Code of get_role: wp-includes/capabilities.php VER 4.9.8

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

Related Functions

From tag: Roles capabilities

No comments
    Hello, !     Log In . Register