Skip to content

Commit 146eb10

Browse files
Merge pull request #217 from BhargavBhandari90/Issue-GH-216
Fix - #216 user description was not getting saved
2 parents 999fdd8 + 52b912e commit 146eb10

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

features/user-meta.feature

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,19 @@ Feature: Manage user custom fields
112112
| user_id | meta_key | meta_value |
113113
| 1 | foo | ["1","2"] |
114114
| 1 | nickname | admin |
115+
116+
Scenario: Get particular user meta
117+
Given a WP install
118+
119+
When I run `wp user create testuser testuser@example.com --description='This is description' --porcelain`
120+
Then STDOUT should be a number
121+
And save STDOUT as {USER_ID}
122+
123+
When I try the previous command again
124+
Then the return code should be 1
125+
126+
When I try `wp user-meta get {USER_ID} description`
127+
Then STDOUT should be:
128+
"""
129+
This is description
130+
"""

src/User_Command.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ public function create( $args, $assoc_args ) {
373373

374374
$user->last_name = \WP_CLI\Utils\get_flag_value( $assoc_args, 'last_name', false );
375375

376+
$user->description = \WP_CLI\Utils\get_flag_value( $assoc_args, 'description', false );
377+
376378
if ( isset( $assoc_args['user_pass'] ) ) {
377379
$user->user_pass = $assoc_args['user_pass'];
378380
} else {

0 commit comments

Comments
 (0)