From: Daniel Bachhuber Date: Sun, 14 Jul 2013 02:12:00 +0000 (-0700) Subject: Update to accommodate scenario when multiple users are passed X-Git-Tag: v0.11.0~34^2~5 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=de5814f005f5e69c41a8fac09cb02c1a7a94ca7e;p=wvm%2Fwvm.git Update to accommodate scenario when multiple users are passed See https://github.com/wp-cli/wp-cli/pull/555#discussion_r5179695 --- 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' ); }