diff --git a/features/user.feature b/features/user.feature index 4f8640e14..cd22acdd6 100644 --- a/features/user.feature +++ b/features/user.feature @@ -352,7 +352,10 @@ Feature: Manage WordPress users | roles | author | When I run `wp user remove-role 1` - Then STDOUT should not be empty + Then STDOUT should contain: + """ + Success: Removed all roles from admin (1) on + """ When I run `wp user get 1` Then STDOUT should be a table containing rows: diff --git a/src/User_Command.php b/src/User_Command.php index 7d7c68959..29cd9ae51 100644 --- a/src/User_Command.php +++ b/src/User_Command.php @@ -807,7 +807,8 @@ public function add_role( $args, $assoc_args ) { * : User ID, user email, or user login. * * [...] - * : Remove the specified role(s) from the user. + * : Remove the specified role(s) from the user. If not passed, all roles are + * removed from the user. * * ## EXAMPLES * @@ -817,6 +818,9 @@ public function add_role( $args, $assoc_args ) { * $ wp user remove-role 12 author editor * Success: Removed 'author', 'editor' roles for johndoe (12). * + * $ wp user remove-role 12 + * Success: Removed all roles from johndoe (12) on http://example.com. + * * @subcommand remove-role */ public function remove_role( $args, $assoc_args ) { @@ -844,7 +848,7 @@ public function remove_role( $args, $assoc_args ) { $user->remove_all_caps(); } - WP_CLI::success( "Removed {$user->user_login} ({$user->ID}) from " . site_url() . '.' ); + WP_CLI::success( "Removed all roles from {$user->user_login} ({$user->ID}) on " . site_url() . '.' ); } }