Make WordPress Core


Ignore:
Timestamp:
09/27/2012 01:57:38 AM (13 years ago)
Author:
nacin
Message:

New color picker, props mattwiebe. see #21206.

Replaces Farbtastic. May change further in response to user testing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-background.php

    r21944 r22030  
    109109        wp_enqueue_script('media-upload');
    110110        wp_enqueue_script('custom-background');
    111         wp_enqueue_style('farbtastic');
     111        wp_enqueue_style('wp-color-picker');
    112112    }
    113113
     
    328328<th scope="row"><?php _e( 'Background Color' ); ?></th>
    329329<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Color' ); ?></span></legend>
    330 <?php $show_clear = get_theme_mod('background_color') ? '' : ' style="display:none"'; ?>
    331 <input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr(get_background_color()) ?>" />
    332 <a class="hide-if-no-js" href="#" id="pickcolor"><?php _e('Select a Color'); ?></a> <span<?php echo $show_clear; ?> class="hide-if-no-js" id="clearcolor"> (<a href="#"><?php current_theme_supports( 'custom-background', 'default-color' ) ? _e( 'Default' ) : _e( 'Clear' ); ?></a>)</span>
    333 <input type="hidden" id="defaultcolor" value="<?php if ( current_theme_supports( 'custom-background', 'default-color' ) ) echo '#' . esc_attr( get_theme_support( 'custom-background', 'default-color' ) ); ?>" />
    334 <div id="colorPickerDiv" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
     330<?php
     331$default_color = '';
     332if ( current_theme_supports( 'custom-background', 'default-color' ) )
     333    $default_color = ' data-default-color="#' . esc_attr( get_theme_support( 'custom-background', 'default-color' ) ) . '"';
     334?>
     335<input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr( get_background_color() ); ?>"<?php echo $default_color ?> />
    335336</fieldset></td>
    336337</tr>
Note: See TracChangeset for help on using the changeset viewer.