Skip to content

Commit 19aa208

Browse files
committed
Adapt error message
1 parent 6ecf307 commit 19aa208

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

features/user.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ Feature: Manage WordPress users
455455
Then the return code should be 1
456456
And STDERR should be:
457457
"""
458-
Error: There is a role similar to 'contributor' capability. Use `wp user remove-cap {USER_ID} contributor --force` to remove capability.
458+
Error: Aborting because a role has the same name as 'contributor'. Use `wp user remove-cap {USER_ID} contributor --force` to proceed with the removal.
459459
"""
460460
And STDOUT should be empty
461461

src/User_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ public function remove_cap( $args, $assoc_args ) {
893893

894894
$user_roles = $user->roles;
895895
if ( ! empty( $user_roles ) && in_array( $cap, $user_roles, true ) && ! Utils\get_flag_value( $assoc_args, 'force' ) ) {
896-
WP_CLI::error( "There is a role similar to '{$cap}' capability. Use `wp user remove-cap {$user->ID} {$cap} --force` to remove capability." );
896+
WP_CLI::error( "Aborting because a role has the same name as '{$cap}'. Use `wp user remove-cap {$user->ID} {$cap} --force` to proceed with the removal." );
897897
}
898898
$user->remove_cap( $cap );
899899

0 commit comments

Comments
 (0)