Skip to main content

Names for a set of user capabilities.

User roles are names for a set of . Each user can have more than one role, but the back end offers just a selector for mutually exclusive roles.

Roles are handled in the classes WP_Roles, WP_Role and WP_User in wp-includes/capabilities.php.

The default roles are set in populate_roles() in wp-admin/includes/schema.php:

_x('Administrator', 'User role');
/* translators: user role */
_x('Editor', 'User role');
/* translators: user role */
_x('Author', 'User role');
/* translators: user role */
_x('Contributor', 'User role');
/* translators: user role */
_x('Subscriber', 'User role');

add_role('administrator', 'Administrator');
add_role('editor', 'Editor');
add_role('author', 'Author');
add_role('contributor', 'Contributor');
add_role('subscriber', 'Subscriber');

Code Language (used for syntax highlighting): lang-php