From de5814f005f5e69c41a8fac09cb02c1a7a94ca7e Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Sat, 13 Jul 2013 19:12:00 -0700 Subject: [PATCH] Update to accommodate scenario when multiple users are passed See https://github.com/wp-cli/wp-cli/pull/555#discussion_r5179695 --- php/commands/user.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/php/commands/user.php b/php/commands/user.php index d4b23b3f..102e1799 100644 --- a/php/commands/user.php +++ b/php/commands/user.php @@ -66,7 +66,9 @@ class User_Command extends \WP_CLI\CommandWithDBObject { 'reassign' => null ) ); - $args[0] = self::get_user_from_first_arg( $args[0] )->ID; + foreach( $args as $key => $arg ) { + $args[$key] = self::get_user_from_first_arg( $arg )->ID; + } parent::delete( $args, $assoc_args ); } @@ -150,7 +152,9 @@ class User_Command extends \WP_CLI\CommandWithDBObject { */ public function update( $args, $assoc_args ) { - $args[0] = self::get_user_from_first_arg( $args[0] )->ID; + foreach( $args as $key => $arg ) { + $args[$key] = self::get_user_from_first_arg( $arg )->ID; + } parent::update( $args, $assoc_args, 'user' ); } -- 2.11.0