diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
index 1c84d42..38db18f 100644
|
|
function wp_ajax_save_user_color_scheme() { |
2600 | 2600 | wp_send_json_error(); |
2601 | 2601 | } |
2602 | 2602 | |
| 2603 | $previous_color_scheme = get_user_meta( get_current_user_id(), 'admin_color', true ); |
2603 | 2604 | update_user_meta( get_current_user_id(), 'admin_color', $color_scheme ); |
2604 | | wp_send_json_success(); |
| 2605 | wp_send_json_success( array( |
| 2606 | 'remove' => 'admin-color-' . $previous_color_scheme, |
| 2607 | 'add' => 'admin-color-' . $color_scheme |
| 2608 | ) ); |
2605 | 2609 | } |
2606 | 2610 | |
2607 | 2611 | /** |
diff --git src/wp-admin/js/user-profile.js src/wp-admin/js/user-profile.js
index ae4b97a..af48f60 100644
|
|
|
119 | 119 | action: 'save-user-color-scheme', |
120 | 120 | color_scheme: $this.children( 'input[name="admin_color"]' ).val(), |
121 | 121 | nonce: $('#color-nonce').val() |
| 122 | }).done( function( response ) { |
| 123 | if ( response.success && response.data.remove && response.data.add ) { |
| 124 | $( 'body' ).removeClass( response.data.remove ).addClass( response.data.add ); |
| 125 | } |
122 | 126 | }); |
123 | 127 | } |
124 | 128 | }); |