Skip to content

Commit 3c65c5d

Browse files
authored
Allow user_url to be set with wp user create (#372)
1 parent bf6ad67 commit 3c65c5d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

features/user.feature

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,3 +497,12 @@ Feature: Manage WordPress users
497497
Success: Updated user 1.
498498
"""
499499
And an email should not be sent
500+
501+
Scenario: Set user url when creating a user
502+
Given a WP install
503+
And I run `wp user create testurl sample@email.com --user_url='http://www.testsite.com'`
504+
505+
When I run `wp user get testurl --fields=user_url`
506+
Then STDOUT should be a table containing rows:
507+
| Field | Value |
508+
| user_url | http://www.testsite.com |

src/User_Command.php

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

409409
$user->description = Utils\get_flag_value( $assoc_args, 'description', false );
410410

411+
$user->user_url = Utils\get_flag_value( $assoc_args, 'user_url', false );
412+
411413
if ( isset( $assoc_args['user_pass'] ) ) {
412414
$user->user_pass = $assoc_args['user_pass'];
413415
} else {

0 commit comments

Comments
 (0)