Skip to content

Commit

Permalink
(fix): multisite config
Browse files Browse the repository at this point in the history
  • Loading branch information
ictbeheer committed Feb 14, 2025
1 parent e320f88 commit e885907
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ See [config](./config/user-roles.php) for all configuration options.

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=%
```
9 changes: 1 addition & 8 deletions src/Console/UserRolesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ public function handle(): void

private function createRolesForSites(): void
{
if (true === is_multisite()) {
foreach (get_sites(['fields' => 'ids']) as $siteId) {
switch_to_blog($siteId);
UserRoles::createRoles();
}
} else {
UserRoles::createRoles();
}
UserRoles::createRoles();
}
}

0 comments on commit e885907

Please sign in to comment.