@@ -385,6 +385,11 @@ function ( $user ) use ( $network, $reassign ) {
385385 * or their numeric forms 1 and 0.
386386 * Default: true
387387 *
388+ * [--syntax_highlighting=<syntax_highlighting>]
389+ * : Whether to enable the rich code editor for the user. Accepts 'true' or 'false',
390+ * or their numeric forms 1 and 0.
391+ * Default: true
392+ *
388393 * [--send-email]
389394 * : Send an email to the user with their new account details.
390395 *
@@ -403,7 +408,7 @@ function ( $user ) use ( $network, $reassign ) {
403408 * 4
404409 *
405410 * @param array{0: string, 1: string} $args Positional arguments.
406- * @param array{role?: string, user_pass?: string, user_registered?: string, display_name?: string, user_nicename?: string, user_url?: string, nickname?: string, first_name?: string, last_name?: string, description?: string, rich_editing?: string, send_email?: bool, porcelain?: bool} $assoc_args Associative arguments.
411+ * @param array{role?: string, user_pass?: string, user_registered?: string, display_name?: string, user_nicename?: string, user_url?: string, nickname?: string, first_name?: string, last_name?: string, description?: string, rich_editing?: string, syntax_highlighting?: string, send_email?: bool, porcelain?: bool} $assoc_args Associative arguments.
407412 */
408413 public function create ( $ args , $ assoc_args ) {
409414 $ user = new stdClass ();
@@ -445,6 +450,9 @@ public function create( $args, $assoc_args ) {
445450 $ rich_editing = Utils \get_flag_value ( $ assoc_args , 'rich_editing ' , true );
446451 $ user ->rich_editing = filter_var ( $ rich_editing , FILTER_VALIDATE_BOOLEAN ) ? 'true ' : 'false ' ;
447452
453+ $ syntax_highlighting = Utils \get_flag_value ( $ assoc_args , 'syntax_highlighting ' , true );
454+ $ user ->syntax_highlighting = filter_var ( $ syntax_highlighting , FILTER_VALIDATE_BOOLEAN ) ? 'true ' : 'false ' ;
455+
448456 if ( isset ( $ assoc_args ['user_pass ' ] ) ) {
449457 $ user ->user_pass = $ assoc_args ['user_pass ' ];
450458 } else {
@@ -544,12 +552,12 @@ public function create( $args, $assoc_args ) {
544552 * : A string containing content about the user.
545553 *
546554 * [--rich_editing=<rich_editing>]
547- * : Whether to enable the rich editor for the user. Accepts 'true' or
548- * 'false' as a string literal, not boolean .
555+ * : Whether to enable the rich editor for the user. Accepts 'true' or 'false',
556+ * or their numeric forms 1 and 0 .
549557 *
550558 * [--syntax_highlighting=<syntax_highlighting>]
551- * : Whether to enable the rich code editor for the user. Accepts 'true' or
552- * 'false' as a string literal, not boolean .
559+ * : Whether to enable the rich code editor for the user. Accepts 'true' or 'false',
560+ * or their numeric forms 1 and 0 .
553561 *
554562 * [--comment_shortcuts=<comment_shortcuts>]
555563 * : Whether to enable comment moderation keyboard shortcuts for the user.
@@ -624,6 +632,11 @@ public function update( $args, $assoc_args ) {
624632 }
625633
626634 $ assoc_args = Utils \parse_shell_arrays ( $ assoc_args , [ 'meta_input ' ] );
635+ foreach ( [ 'rich_editing ' , 'syntax_highlighting ' ] as $ preference ) {
636+ if ( isset ( $ assoc_args [ $ preference ] ) ) {
637+ $ assoc_args [ $ preference ] = filter_var ( $ assoc_args [ $ preference ], FILTER_VALIDATE_BOOLEAN ) ? 'true ' : 'false ' ;
638+ }
639+ }
627640
628641 $ assoc_args = wp_slash ( $ assoc_args );
629642 parent ::_update ( $ user_ids , $ assoc_args , 'wp_update_user ' );
0 commit comments