Adds, removes, and lists capabilities of a user role.
See references for Roles and Capabilities and WP User class.
EXAMPLES EXAMPLES
# Add 'spectate' capability to 'author' role.
$ wp cap add 'author' 'spectate'
Success: Added 1 capability to 'author' role.
# Add all caps from 'editor' role to 'author' role.
$ wp cap list 'editor' | xargs wp cap add 'author'
Success: Added 24 capabilities to 'author' role.
# Remove all caps from 'editor' role that also appear in 'author' role.
$ wp cap list 'author' | xargs wp cap remove 'editor'
Success: Removed 34 capabilities from 'editor' role.
SUBCOMMANDS SUBCOMMANDS
Name | Description |
---|---|
wp cap add | Adds capabilities to a given role. |
wp cap list | Lists capabilities for a given role. |
wp cap remove | Removes capabilities from a given role. |
Command documentation is regenerated at every release. To add or update an example, please submit a pull request against the corresponding part of the codebase.