diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 885c21002a..02a0a4e074 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -2249,9 +2249,7 @@ function wp_ajax_get_revision_diffs() { function wp_ajax_save_user_color_scheme() { global $_wp_admin_css_colors; - $user_id = get_current_user_id(); - - check_ajax_referer( 'save-color-scheme_' . $user_id, 'nonce' ); + check_ajax_referer( 'save-color-scheme', 'nonce' ); $color_scheme = sanitize_key( $_POST['color_scheme'] ); @@ -2259,6 +2257,6 @@ function wp_ajax_save_user_color_scheme() { wp_send_json_error(); } - update_user_meta( $user_id, 'admin_color', $color_scheme ); + update_user_meta( get_current_user_id(), 'admin_color', $color_scheme ); wp_send_json_success(); } diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index d82b4fccd1..d48a94fafb 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -562,7 +562,7 @@ function saveDomDocument($doc, $filename) { * @since 3.0.0 */ function admin_color_scheme_picker() { - global $_wp_admin_css_colors, $user_id; + global $_wp_admin_css_colors; ksort( $_wp_admin_css_colors ); @@ -571,7 +571,7 @@ function admin_color_scheme_picker() { $_wp_admin_css_colors = array_merge( array( 'fresh' => '', 'light' => '' ), $_wp_admin_css_colors ); } - $current_color = get_user_option( 'admin_color', $user_id ); + $current_color = get_user_option( 'admin_color' ); if ( empty( $current_color ) || ! isset( $_wp_admin_css_colors[ $current_color ] ) ) { $current_color = 'fresh'; @@ -581,7 +581,7 @@ function admin_color_scheme_picker() {