Skip to content

Commit 986adb9

Browse files
committed
Update success and error messages
1 parent 660fff5 commit 986adb9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

features/signup.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Feature: Manage signups in a multisite installation
3131
When I run `wp signup activate bobuser`
3232
Then STDOUT should contain:
3333
"""
34-
Success: Signup activated.
34+
Success: Signup 1 activated.
3535
"""
3636

3737
When I run `wp signup list --fields=signup_id,user_login,user_email,active --format=csv --active=1`
@@ -65,7 +65,7 @@ Feature: Manage signups in a multisite installation
6565
When I run `wp signup delete bobuser@example.com`
6666
Then STDOUT should be:
6767
"""
68-
Success: Signup deleted.
68+
Success: Signup 1 deleted.
6969
"""
7070

7171
When I try `wp signup get bobuser`
@@ -87,7 +87,7 @@ Feature: Manage signups in a multisite installation
8787
When I run `wp signup activate bobuser`
8888
Then STDOUT should contain:
8989
"""
90-
Success: Signup activated.
90+
Success: Signup 1 activated.
9191
"""
9292

9393
When I run `wp signup get bobuser --field=active`
@@ -116,7 +116,7 @@ Feature: Manage signups in a multisite installation
116116
When I run `wp signup activate bobuser`
117117
Then STDOUT should contain:
118118
"""
119-
Success: Signup activated.
119+
Success: Signup 1 activated.
120120
"""
121121

122122
When I run `wp site list --fields=domain,path`

src/Signup_Command.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ public function activate( $args, $assoc_args ) {
222222
}
223223

224224
if ( is_wp_error( $result ) ) {
225-
WP_CLI::error( 'Signup could not be activated. Reason: ' . $result->get_error_message() );
225+
WP_CLI::error( "Failed activating signup {$signup->signup_id}." );
226226
} else {
227-
WP_CLI::success( "Signup activated. Password: {$result['password']}" );
227+
WP_CLI::success( "Signup {$signup->signup_id} activated. Password: {$result['password']}" );
228228
}
229229
}
230230

@@ -252,9 +252,9 @@ public function delete( $args, $assoc_args ) {
252252
$result = $wpdb->delete( $wpdb->signups, array( 'signup_id' => $signup->signup_id ), array( '%d' ) );
253253

254254
if ( $result ) {
255-
WP_CLI::success( 'Signup deleted.' );
255+
WP_CLI::success( "Signup {$signup->signup_id} deleted." );
256256
} else {
257-
WP_CLI::error( 'Error occurred while deleting signup.' );
257+
WP_CLI::error( "Failed deleting signup {$signup->signup_id}." );
258258
}
259259
}
260260
}

0 commit comments

Comments
 (0)