WordPress.org

Make WordPress Core

Changeset 26793


Ignore:
Timestamp:
12/08/2013 07:05:01 AM (5 years ago)
Author:
nacin
Message:

Nonces are already per-user. see #22862.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r26776 r26793  
    22502250    global $_wp_admin_css_colors;
    22512251
    2252     $user_id = get_current_user_id();
    2253 
    2254     check_ajax_referer( 'save-color-scheme_' . $user_id, 'nonce' );
     2252    check_ajax_referer( 'save-color-scheme', 'nonce' );
    22552253
    22562254    $color_scheme = sanitize_key( $_POST['color_scheme'] );
     
    22602258    }
    22612259
    2262     update_user_meta( $user_id, 'admin_color', $color_scheme );
     2260    update_user_meta( get_current_user_id(), 'admin_color', $color_scheme );
    22632261    wp_send_json_success();
    22642262}
  • trunk/src/wp-admin/includes/misc.php

    r26776 r26793  
    563563 */
    564564function admin_color_scheme_picker() {
    565     global $_wp_admin_css_colors, $user_id;
     565    global $_wp_admin_css_colors;
    566566
    567567    ksort( $_wp_admin_css_colors );
     
    572572    }
    573573
    574     $current_color = get_user_option( 'admin_color', $user_id );
     574    $current_color = get_user_option( 'admin_color' );
    575575
    576576    if ( empty( $current_color ) || ! isset( $_wp_admin_css_colors[ $current_color ] ) ) {
     
    582582        <legend class="screen-reader-text"><span><?php _e( 'Admin Color Scheme' ); ?></span></legend>
    583583        <?php
    584         wp_nonce_field( 'save-color-scheme_' . $user_id, 'color-nonce', false );
     584        wp_nonce_field( 'save-color-scheme', 'color-nonce', false );
    585585        foreach ( $_wp_admin_css_colors as $color => $color_info ) :
    586586
Note: See TracChangeset for help on using the changeset viewer.