get_role

Advertisement

Summery Summery

Retrieve role object.

Syntax Syntax

get_role( string $role )

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

 * capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to
 * map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`.
 *

Advertisement

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.