WordPress.org

Make WordPress Core

Changeset 26776


Ignore:
Timestamp:
12/07/2013 07:45:57 AM (6 years ago)
Author:
nacin
Message:

Core updates for the new color schemes.

  • Update about page, there's now 8.
  • Display them four wide, not three, and ensure adequate spacing.
  • Use a dedicated nonce.
  • Push Light to the front in addition to Default.
  • Use user-profile.js on about.php. A few extra things are initialized but they are harmless.

see #26468, #26387.

Location:
trunk/src
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/about.php

    r26764 r26776  
    8080        <div>
    8181            <h3><?php echo ( 'Pick a color' ); ?></h3>
    82             <p><?php echo ( 'We&#8217;ve included four color schemes so that you can pick your favorite. Choose from any of the schemes below to change it in an instant.' ); ?></p>
     82            <p><?php echo ( 'We&#8217;ve included eight color schemes so you can pick your favorite. Choose from any of them below to change it in an instant.' ); ?></p>
    8383            <?php $user_id = get_current_user_id(); ?>
    8484            <?php if ( count($_wp_admin_css_colors) > 1 && has_action('admin_color_scheme_picker') ) :?>
    8585                <?php
    86                 wp_nonce_field('update-user_' . $user_id);
    8786                /** This action is documented in wp-admin/user-edit.php */
    8887                do_action( 'admin_color_scheme_picker' );
     
    9190                <img src="<?php echo admin_url( 'images/about-color-schemes.png' ); ?>" />
    9291            <?php endif; ?>
    93             <p><?php printf( ( 'To change your color scheme later, just <a href="%1$s">visit your profile settings</a>.' ), get_edit_profile_url( $user_id ) ); ?></p>
     92            <p><?php printf( ( 'To change your color scheme later, just <a href="%1$s">visit your profile</a>.' ), get_edit_profile_url( $user_id ) ); ?></p>
    9493        </div>
    9594    </div>
  • trunk/src/wp-admin/css/wp-admin.css

    r26772 r26776  
    76397639.color-option {
    76407640    display: inline-block;
    7641     width: 32%;
     7641    width: 24%;
    76427642    padding: 5px 15px 15px;
    76437643    -moz-box-sizing: border-box;
    76447644    box-sizing: border-box;
     7645    margin-bottom: 3px;
    76457646}
    76467647
     
    80308031
    80318032.about-wrap .about-colors .color-option {
    8032     width: 24%;
    80338033    padding-top: 10px;
    80348034}
  • trunk/src/wp-admin/includes/ajax-actions.php

    r26535 r26776  
    22512251
    22522252    $user_id = get_current_user_id();
    2253     check_ajax_referer( 'update-user_' . $user_id, 'nonce' );
     2253
     2254    check_ajax_referer( 'save-color-scheme_' . $user_id, 'nonce' );
    22542255
    22552256    $color_scheme = sanitize_key( $_POST['color_scheme'] );
  • trunk/src/wp-admin/includes/misc.php

    r26732 r26776  
    568568
    569569    if ( isset( $_wp_admin_css_colors['fresh'] ) ) {
    570         // Set 'fresh' (the default option) to be the first array element
    571         $_wp_admin_css_colors = array_merge( array( 'fresh' => '' ), $_wp_admin_css_colors );
     570        // Set Default ('fresh') and Light should go first.
     571        $_wp_admin_css_colors = array_merge( array( 'fresh' => '', 'light' => '' ), $_wp_admin_css_colors );
    572572    }
    573573
     
    582582        <legend class="screen-reader-text"><span><?php _e( 'Admin Color Scheme' ); ?></span></legend>
    583583        <?php
    584 
     584        wp_nonce_field( 'save-color-scheme_' . $user_id, 'color-nonce', false );
    585585        foreach ( $_wp_admin_css_colors as $color => $color_info ) :
    586586
     
    597597                    foreach ( $color_info->colors as $html_color ) {
    598598                        ?>
    599                         <td style="background-color: <?php echo esc_attr( $html_color ); ?>" title="<?php echo esc_attr( $color ); ?>">&nbsp;</td>
     599                        <td style="background-color: <?php echo esc_attr( $html_color ); ?>">&nbsp;</td>
    600600                        <?php
    601601                    }
  • trunk/src/wp-admin/js/user-profile.js

    r26693 r26776  
    115115                    action:       'save-user-color-scheme',
    116116                    color_scheme: $this.children( 'input[name="admin_color"]' ).val(),
    117                     nonce:        $('#_wpnonce').val()
     117                    nonce:        $('#color-nonce').val()
    118118                });
    119119            }
  • trunk/src/wp-includes/script-loader.php

    r26693 r26776  
    332332    $scripts->add( 'user-suggest', "/wp-admin/js/user-suggest$suffix.js", array( 'jquery-ui-autocomplete' ), false, 1 );
    333333
    334     $scripts->add( 'about', "/wp-admin/js/about$suffix.js", array( 'jquery', 'password-strength-meter' ), false, 1 );
     334    $scripts->add( 'about', false, array( 'user-profile' ), false );
    335335
    336336    $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 );
Note: See TracChangeset for help on using the changeset viewer.