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

Add role, if it does not exist.

Related Functions

add_filter, wp_roles, add_feed, add_link, get_role

Top Google Results

User discussions

wpseek mobile