get_role( string $role )
Retrieve role object.
Description Description
Parameters Parameters
- $role
-
(string) (Required) Role name.
Return Return
(WP_Role|null) WP_Role object if found, null if the role does not exist.
Source Source
File: wp-includes/capabilities.php
function get_role( $role ) { return wp_roles()->get_role( $role ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
Sample Returned Object
Expand full source codeCollapse full source code