add_role


add_role ( $role, $display_name, $capabilities = array() )

Parameters:
  • (string) role Role name.
  • (string) display_name Display name for role.
  • (bool[]) capabilities List of capabilities keyed by the capability name, e.g. array( 'edit_posts' => true, 'delete_posts' => false ).
Returns:
  • (WP_Role|null) WP_Role object if role is added, null if already exists.
Defined at:

Description

Adds a role, if it does not exist.

Related Functions

add_filter, wp_roles, get_role, add_feed, add_link

Top Google Results

User discussions

wpseek mobile