Download the PHP package roots/acorn-user-roles without Composer
On this page you can find all versions of the php package roots/acorn-user-roles. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download roots/acorn-user-roles
More information about roots/acorn-user-roles
Files in roots/acorn-user-roles
Package acorn-user-roles
Short Description Simple user role management for Acorn.
License MIT
Informations about the package acorn-user-roles
Acorn User Roles
Simple user role management for Acorn.
Support us
Roots is an independent open source org, supported only by developers like you. Your sponsorship funds WP Packages and the entire Roots ecosystem, and keeps them independent. Support us by purchasing Radicle or sponsoring us on GitHub — sponsors get access to our private Discord.
Requirements
Installation
Install via Composer:
Getting Started
Start by optionally publishing the user-roles config:
Usage
User roles can be configured in the published config/user-roles.php file.
Adding a role
Capabilities can also be defined as an associative array:
Removing a role
Since roles are stored in the database, removing a role from the config will not delete it. To remove a role, set it to false:
Note: Setting a role to
falsepermanently removes it from the database. Removing the line from config afterward will not restore it. To restore a removed role, use WP-CLI:wp role reset subscriber(orwp role reset --allto restore all default roles).
Updating an existing role
Capabilities defined in config are synced on every request. If you change the capabilities or display name for an existing role, the configured values will be applied.
Capabilities not included in the config are left untouched, so capabilities added by other plugins are preserved. To explicitly deny a capability, set it to false:
Strict mode
If you want the config to be the single source of truth for a role, set strict to true. Any capabilities not listed in the config will be removed. In other words: false denies a listed capability, while strict removes unlisted capabilities.
Community
Keep track of development and community news.
- Join us on Discord by sponsoring us on GitHub
- Join us on Roots Discourse
- Follow @rootswp on Twitter
- Follow the Roots Blog
- Subscribe to the Roots Newsletter