WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/28/2010 06:34:31 AM (12 years ago)
Author:
dd32
Message:

Move Admin Colour Scheme picker to a hook. Props Jick. s/register_admin_color_themes()/register_admin_color_schemes/g. See #11625, Fixes #6837

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/misc.php

    r13425 r13487  
    663663    @header( 'X-Content-Type-Options: nosniff' );
    664664}
     665/**
     666 * Display the default admin color scheme picker (Used in user-edit.php)
     667 *
     668 * @since 3.0
     669 */
     670function admin_color_scheme_picker() {
     671    global $_wp_admin_css_colors, $user_id; ?>
     672<fieldset><legend class="screen-reader-text"><span><?php _e('Admin Color Scheme')?></span></legend>
     673<?php
     674$current_color = get_user_option('admin_color', $user_id);
     675if ( empty($current_color) )
     676    $current_color = 'fresh';
     677foreach ( $_wp_admin_css_colors as $color => $color_info ): ?>
     678<div class="color-option"><input name="admin_color" id="admin_color_<?php echo $color; ?>" type="radio" value="<?php echo esc_attr($color) ?>" class="tog" <?php checked($color, $current_color); ?> />
     679    <table class="color-palette">
     680    <tr>
     681    <?php foreach ( $color_info->colors as $html_color ): ?>
     682    <td style="background-color: <?php echo $html_color ?>" title="<?php echo $color ?>">&nbsp;</td>
     683    <?php endforeach; ?>
     684    </tr>
     685    </table>
     686
     687    <label for="admin_color_<?php echo $color; ?>"><?php echo $color_info->name ?></label>
     688</div>
     689    <?php endforeach; ?>
     690</fieldset>
     691<?php
     692}
    665693?>
Note: See TracChangeset for help on using the changeset viewer.