Changeset 26137 for trunk/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 11/13/2013 07:37:10 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r25868 r26137 2245 2245 wp_send_json_success( $return ); 2246 2246 } 2247 2248 /** 2249 * Auto-save the selected color scheme for a user's own profile. 2250 * 2251 * @since 3.8.0 2252 */ 2253 function wp_ajax_save_user_color_scheme() { 2254 global $_wp_admin_css_colors; 2255 2256 $user_id = intval( $_POST['user_id'] ); 2257 $color_scheme = sanitize_key( $_POST['color_scheme'] ); 2258 2259 if ( get_current_user_id() !== $user_id ) 2260 wp_send_json_error(); 2261 2262 if ( ! get_user_by( 'id', $user_id ) ) 2263 wp_send_json_error(); 2264 2265 if ( ! isset( $_wp_admin_css_colors[ $color_scheme ] ) ) 2266 wp_send_json_error(); 2267 2268 update_user_option( $user_id, 'admin_color', $color_scheme, true ); 2269 wp_send_json_success(); 2270 }
Note: See TracChangeset
for help on using the changeset viewer.