Ticket #26607: 26607.2.patch
File 26607.2.patch, 2.2 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/ajax-actions.php
2244 2244 /** 2245 2245 * Auto-save the selected color scheme for a user's own profile. 2246 2246 * 2247 * @since 2247 * @since 3.8.0 2248 2248 */ 2249 2249 function wp_ajax_save_user_color_scheme() { 2250 2250 global $_wp_admin_css_colors; … … 2257 2257 wp_send_json_error(); 2258 2258 } 2259 2259 2260 update_user_meta( get_current_user_id(), 'admin_color', $color_scheme ); 2260 $user_id = ( isset( $_POST['user_id'] ) ) ? (int) $_POST['user_id'] : get_current_user_id(); 2261 update_user_meta( $user_id, 'admin_color', $color_scheme ); 2262 2261 2263 wp_send_json_success(); 2262 2264 } -
src/wp-admin/includes/misc.php
571 571 $_wp_admin_css_colors = array_filter( array_merge( array( 'fresh' => '', 'light' => '' ), $_wp_admin_css_colors ) ); 572 572 } 573 573 574 $current_color = get_user_option( 'admin_color' ); 574 $user_id = ( isset( $_GET['user_id'] ) ) ? (int) $_GET['user_id'] : get_current_user_id(); 575 $current_color = get_user_option( 'admin_color', $user_id ); 575 576 576 577 if ( empty( $current_color ) || ! isset( $_wp_admin_css_colors[ $current_color ] ) ) { 577 578 $current_color = 'fresh'; -
src/wp-admin/js/user-profile.js
109 109 wp.svgPainter.paint(); 110 110 } 111 111 } 112 } 112 113 113 114 115 116 color_scheme: $this.children( 'input[name="admin_color"]' ).val(),117 nonce: $('#color-nonce').val()118 });119 } 114 // update user option 115 $.post( ajaxurl, { 116 action: 'save-user-color-scheme', 117 user_id: user_id, 118 color_scheme: $this.children( 'input[name="admin_color"]' ).val(), 119 nonce: $('#color-nonce').val() 120 }); 120 121 }); 121 122 }); 122 123