@@ -518,9 +518,6 @@ public function create( $args, $assoc_args ) {
518518 * [--role=<role>]
519519 * : A string used to set the user's role.
520520 *
521- * --<field>=<value>
522- * : One or more fields to update. For accepted fields, see wp_update_user().
523- *
524521 * [--skip-email]
525522 * : Don't send an email notification to the user.
526523 *
@@ -536,49 +533,6 @@ public function update( $args, $assoc_args ) {
536533 unset( $ assoc_args ['user_login ' ] );
537534 }
538535
539- // Define valid fields for wp_update_user().
540- $ valid_fields = array (
541- 'user_pass ' ,
542- 'user_nicename ' ,
543- 'user_url ' ,
544- 'user_email ' ,
545- 'display_name ' ,
546- 'nickname ' ,
547- 'first_name ' ,
548- 'last_name ' ,
549- 'description ' ,
550- 'rich_editing ' ,
551- 'user_registered ' ,
552- 'role ' ,
553- 'syntax_highlighting ' ,
554- 'comment_shortcuts ' ,
555- 'admin_color ' ,
556- 'use_ssl ' ,
557- 'show_admin_bar_front ' ,
558- 'locale ' ,
559- );
560-
561- // Check for invalid field names.
562- $ invalid_fields = array ();
563- foreach ( array_keys ( $ assoc_args ) as $ field ) {
564- // Skip special flags like 'skip-email'.
565- if ( 'skip-email ' === $ field ) {
566- continue ;
567- }
568-
569- if ( ! in_array ( $ field , $ valid_fields , true ) ) {
570- $ invalid_fields [] = $ field ;
571- }
572- }
573-
574- // Warn about invalid fields.
575- if ( ! empty ( $ invalid_fields ) ) {
576- foreach ( $ invalid_fields as $ field ) {
577- WP_CLI ::warning ( "Unknown -- {$ field } parameter. " );
578- unset( $ assoc_args [ $ field ] );
579- }
580- }
581-
582536 if ( isset ( $ assoc_args ['role ' ] ) ) {
583537 self ::validate_role ( $ assoc_args ['role ' ], true );
584538 }
0 commit comments