diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php
index 79286f1014..cb4bc4017e 100644
a
|
b
|
function edit_user( $user_id = 0 ) { |
112 | 112 | } |
113 | 113 | |
114 | 114 | if ( $update ) { |
115 | | $user->rich_editing = isset( $_POST['rich_editing'] ) && 'false' === $_POST['rich_editing'] ? 'false' : 'true'; |
116 | | $user->syntax_highlighting = isset( $_POST['syntax_highlighting'] ) && 'false' === $_POST['syntax_highlighting'] ? 'false' : 'true'; |
| 115 | $user->rich_editing = isset( $_POST['rich_editing'] ) && $_POST['rich_editing'] === 'false' ? false : true; |
| 116 | $user->syntax_highlighting = isset( $_POST['syntax_highlighting'] ) && $_POST['syntax_highlighting'] === 'false' ? false : true; |
117 | 117 | $user->admin_color = isset( $_POST['admin_color'] ) ? sanitize_text_field( $_POST['admin_color'] ) : 'fresh'; |
118 | | $user->show_admin_bar_front = isset( $_POST['admin_bar_front'] ) ? 'true' : 'false'; |
| 118 | $user->show_admin_bar_front = isset( $_POST['admin_bar_front'] ) && $_POST['admin_bar_front'] === 'false' ? true : false; |
119 | 119 | $user->locale = ''; |
120 | 120 | |
121 | 121 | if ( isset( $_POST['locale'] ) ) { |
diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php
index b1547886d5..d4b306f100 100644
a
|
b
|
if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) : |
314 | 314 | <th scope="row"><?php _e( 'Toolbar' ); ?></th> |
315 | 315 | <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Toolbar' ); ?></span></legend> |
316 | 316 | <label for="admin_bar_front"> |
317 | | <input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1"<?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> /> |
| 317 | <input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="false" <?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> /> |
318 | 318 | <?php _e( 'Show Toolbar when viewing site' ); ?></label><br /> |
319 | 319 | </fieldset> |
320 | 320 | </td> |
diff --git a/wp-includes/user.php b/wp-includes/user.php
index 1bf62632ad..d73d89e9fe 100644
a
|
b
|
function validate_username( $username ) { |
1478 | 1478 | * if `$display_name` is not specified. |
1479 | 1479 | * @type string $description The user's biographical description. |
1480 | 1480 | * @type string|bool $rich_editing Whether to enable the rich-editor for the user. |
1481 | | * False if not empty. |
| 1481 | * Default true. |
1482 | 1482 | * @type string|bool $syntax_highlighting Whether to enable the rich code editor for the user. |
1483 | | * False if not empty. |
| 1483 | * Default true. |
1484 | 1484 | * @type string|bool $comment_shortcuts Whether to enable comment moderation keyboard |
1485 | 1485 | * shortcuts for the user. Default false. |
1486 | 1486 | * @type string $admin_color Admin color scheme for the user. Default 'fresh'. |
… |
… |
function wp_insert_user( $userdata ) { |
1692 | 1692 | */ |
1693 | 1693 | $meta['description'] = apply_filters( 'pre_user_description', $description ); |
1694 | 1694 | |
1695 | | $meta['rich_editing'] = empty( $userdata['rich_editing'] ) ? 'true' : $userdata['rich_editing']; |
| 1695 | $meta['rich_editing'] = isset( $userdata['rich_editing'] ) && empty( $userdata['rich_editing'] ) ? 'false' : 'true'; |
1696 | 1696 | |
1697 | | $meta['syntax_highlighting'] = empty( $userdata['syntax_highlighting'] ) ? 'true' : $userdata['syntax_highlighting']; |
| 1697 | $meta['syntax_highlighting'] = isset( $userdata['syntax_highlighting'] ) && empty( $userdata['syntax_highlighting'] ) ? 'false' : 'true'; |
1698 | 1698 | |
1699 | 1699 | $meta['comment_shortcuts'] = empty( $userdata['comment_shortcuts'] ) || 'false' === $userdata['comment_shortcuts'] ? 'false' : 'true'; |
1700 | 1700 | |
… |
… |
function wp_insert_user( $userdata ) { |
1705 | 1705 | |
1706 | 1706 | $user_registered = empty( $userdata['user_registered'] ) ? gmdate( 'Y-m-d H:i:s' ) : $userdata['user_registered']; |
1707 | 1707 | |
1708 | | $meta['show_admin_bar_front'] = empty( $userdata['show_admin_bar_front'] ) ? 'true' : $userdata['show_admin_bar_front']; |
| 1708 | $meta['show_admin_bar_front'] = isset( $userdata['show_admin_bar_front'] ) && empty( $userdata['show_admin_bar_front'] ) ? 'false' : 'true'; |
1709 | 1709 | |
1710 | 1710 | $meta['locale'] = isset( $userdata['locale'] ) ? $userdata['locale'] : ''; |
1711 | 1711 | |
… |
… |
function wp_insert_user( $userdata ) { |
1782 | 1782 | * @type string $first_name The user's first name. |
1783 | 1783 | * @type string $last_name The user's last name. |
1784 | 1784 | * @type string $description The user's description. |
1785 | | * @type bool $rich_editing Whether to enable the rich-editor for the user. False if not empty. |
1786 | | * @type bool $syntax_highlighting Whether to enable the rich code editor for the user. False if not empty. |
| 1785 | * @type bool $rich_editing Whether to enable the rich-editor for the user. Default true |
| 1786 | * @type bool $syntax_highlighting Whether to enable the rich code editor for the user. Default true |
1787 | 1787 | * @type bool $comment_shortcuts Whether to enable keyboard shortcuts for the user. Default false. |
1788 | 1788 | * @type string $admin_color The color scheme for a user's admin screen. Default 'fresh'. |
1789 | 1789 | * @type int|bool $use_ssl Whether to force SSL on the user's admin area. 0|false if SSL is |