From: Daniel Bachhuber Date: Tue, 25 Jun 2013 21:10:49 +0000 (-0700) Subject: For most `wp user` subcommands, the first argument can be user ID or login X-Git-Tag: v0.11.0~34^2~7 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c5e1f4212b99610386deb5d97b198aad7959a8ae;p=wvm%2Fwvm.git For most `wp user` subcommands, the first argument can be user ID or login --- diff --git a/php/commands/user.php b/php/commands/user.php index 3533ec80..d4b23b3f 100644 --- a/php/commands/user.php +++ b/php/commands/user.php @@ -59,13 +59,14 @@ class User_Command extends \WP_CLI\CommandWithDBObject { /** * Delete one or more users. * - * @synopsis ... [--reassign=] + * @synopsis ... [--reassign=] */ public function delete( $args, $assoc_args ) { $assoc_args = wp_parse_args( $assoc_args, array( 'reassign' => null ) ); + $args[0] = self::get_user_from_first_arg( $args[0] )->ID; parent::delete( $args, $assoc_args ); } @@ -145,9 +146,11 @@ class User_Command extends \WP_CLI\CommandWithDBObject { /** * Update a user. * - * @synopsis ... --= + * @synopsis ... --= */ public function update( $args, $assoc_args ) { + + $args[0] = self::get_user_from_first_arg( $args[0] )->ID; parent::update( $args, $assoc_args, 'user' ); } @@ -212,7 +215,7 @@ class User_Command extends \WP_CLI\CommandWithDBObject { * Set the user role (for a particular blog). * * @subcommand set-role - * @synopsis [] + * @synopsis [] */ public function set_role( $args, $assoc_args ) { $user = self::get_user_from_first_arg( $args[0] ); @@ -232,7 +235,7 @@ class User_Command extends \WP_CLI\CommandWithDBObject { * Add a role for a user. * * @subcommand add-role - * @synopsis + * @synopsis */ public function add_role( $args, $assoc_args ) { $user = self::get_user_from_first_arg( $args[0] ); @@ -248,7 +251,7 @@ class User_Command extends \WP_CLI\CommandWithDBObject { * Remove a user's role. * * @subcommand remove-role - * @synopsis [] + * @synopsis [] */ public function remove_role( $args, $assoc_args ) { $user = self::get_user_from_first_arg( $args[0] );