diff --git a/README.md b/README.md index b9cf99d2..483d87d4 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,12 @@ Resets any default role to default capabilities. wp role reset [...] [--all] ~~~ +Uses WordPress' `populate_roles()` function to put one or more +roles back into the state they were at in the a fresh +WordPress install. Removes any capabilities that were added, +and restores any capabilities that were removed. Custom roles +are not affected. + **OPTIONS** [...] @@ -197,9 +203,17 @@ wp role reset [...] [--all] **EXAMPLES** - # Reset role. + # Reset three roles. $ wp role reset administrator author contributor - Success: Reset 1/3 roles. + Restored 1 capability to and removed 0 capabilities from 'administrator' role. + No changes necessary for 'author' role. + No changes necessary for 'contributor' role. + Success: 1 of 3 roles reset. + + # Reset a custom role. + $ wp role reset custom_role + Custom role 'custom_role' not affected. + Error: Must specify a default role to reset. # Reset all default roles. $ wp role reset --all diff --git a/src/Role_Command.php b/src/Role_Command.php index b64a5981..9decfd73 100644 --- a/src/Role_Command.php +++ b/src/Role_Command.php @@ -245,6 +245,12 @@ public function delete( $args ) { /** * Resets any default role to default capabilities. * + * Uses WordPress' `populate_roles()` function to put one or more + * roles back into the state they were at in the a fresh + * WordPress install. Removes any capabilities that were added, + * and restores any capabilities that were removed. Custom roles + * are not affected. + * * ## OPTIONS * * [...] @@ -255,9 +261,17 @@ public function delete( $args ) { * * ## EXAMPLES * - * # Reset role. + * # Reset three roles. * $ wp role reset administrator author contributor - * Success: Reset 1/3 roles. + * Restored 1 capability to and removed 0 capabilities from 'administrator' role. + * No changes necessary for 'author' role. + * No changes necessary for 'contributor' role. + * Success: 1 of 3 roles reset. + * + * # Reset a custom role. + * $ wp role reset custom_role + * Custom role 'custom_role' not affected. + * Error: Must specify a default role to reset. * * # Reset all default roles. * $ wp role reset --all