File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -352,7 +352,10 @@ Feature: Manage WordPress users
352352 | roles | author |
353353
354354 When I run `wp user remove-role 1`
355- Then STDOUT should not be empty
355+ Then STDOUT should be:
356+ """
357+ Success: Removed all roles from admin (1).
358+ """
356359
357360 When I run `wp user get 1`
358361 Then STDOUT should be a table containing rows:
Original file line number Diff line number Diff line change @@ -807,7 +807,8 @@ public function add_role( $args, $assoc_args ) {
807807 * : User ID, user email, or user login.
808808 *
809809 * [<role>...]
810- * : Remove the specified role(s) from the user.
810+ * : Remove the specified role(s) from the user. If not passed, all roles are
811+ * removed from the user.
811812 *
812813 * ## EXAMPLES
813814 *
@@ -817,6 +818,9 @@ public function add_role( $args, $assoc_args ) {
817818 * $ wp user remove-role 12 author editor
818819 * Success: Removed 'author', 'editor' roles for johndoe (12).
819820 *
821+ * $ wp user remove-role 12
822+ * Success: Removed all roles from johndoe (12).
823+ *
820824 * @subcommand remove-role
821825 */
822826 public function remove_role ( $ args , $ assoc_args ) {
@@ -844,7 +848,7 @@ public function remove_role( $args, $assoc_args ) {
844848 $ user ->remove_all_caps ();
845849 }
846850
847- WP_CLI ::success ( "Removed {$ user ->user_login } ( {$ user ->ID }) from " . site_url () . ' . ' );
851+ WP_CLI ::success ( "Removed all roles from {$ user ->user_login } ( {$ user ->ID }). " );
848852 }
849853 }
850854
You can’t perform that action at this time.
0 commit comments