https://github.com/yardinternet/wp-user-roles
An Acorn package for managing user roles in WordPress.
https://github.com/yardinternet/wp-user-roles
acorn wordpress
Last synced: 6 months ago
JSON representation
An Acorn package for managing user roles in WordPress.
- Host: GitHub
- URL: https://github.com/yardinternet/wp-user-roles
- Owner: yardinternet
- License: mit
- Created: 2024-06-27T11:27:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-28T19:29:43.000Z (about 1 year ago)
- Last Synced: 2024-11-28T20:27:36.900Z (about 1 year ago)
- Topics: acorn, wordpress
- Language: PHP
- Homepage:
- Size: 365 KB
- Stars: 7
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wp-user-roles
[](https://github.com/yardinternet/wp-user-roles/actions/workflows/format-php.yml)
[](https://github.com/yardinternet/wp-user-roles/actions/workflows/phpstan.yml)
[](https://github.com/yardinternet/wp-user-roles/actions/workflows/run-tests.yml)
[](https://github.com/yardinternet/wp-user-roles/actions/workflows/badges.yml)
[](https://github.com/yardinternet/wp-user-roles/actions/workflows/badges.yml)
An Acorn package for managing user roles in WordPress.
## Features
- [x] Configure: Define custom roles and capabilities with a configuration file.
- [x] (Re)Create: Insert roles into the database with a single wp-cli command.
- [x] Clone roles: Quickly set up new roles based on existing ones.
- [x] Delete roles: Remove any roles that you don’t need.
See [config](./config/user-roles.php) for all configuration options.
## Requirements
- [Sage](https://github.com/roots/sage) >= 10.0
- [Acorn](https://github.com/roots/acorn) >= 4.0
## Installation
1. Install this package with Composer:
```sh
composer require yard/wp-user-roles
```
2. Run the Acorn WP-CLI command to discover this package:
```shell
wp acorn package:discover
```
## Usage
1. Publish the config file with:
```shell
wp acorn vendor:publish --provider="Yard\UserRoles\UserRolesServiceProvider"
```
2. Run WP-CLI command to create roles:
Single site:
```shell
wp acorn roles:create
```
In a multisite:
```shell
wp site list --field=url | xargs -n1 -I % wp acorn roles:create --url=%
```