Uses
Uses | Description |
---|---|
wp-includes/capabilities.php: wp_roles() | Retrieves the global WP_Roles instance and instantiates it if necessary. |
wp-includes/class-wp-roles.php: WP_Roles::get_role() | Retrieve role object by name. |
Retrieve role object.
(string) (Required) Role name.
(WP_Role|null) WP_Role object if found, null if the role does not exist.
File: wp-includes/capabilities.php
function get_role( $role ) { return wp_roles()->get_role( $role ); }
Version | Description |
---|---|
2.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_role