mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
New color picker, props mattwiebe. see #21206.
Replaces Farbtastic. May change further in response to user testing. git-svn-id: https://develop.svn.wordpress.org/trunk@22030 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -351,8 +351,8 @@ class WP_Customize_Color_Control extends WP_Customize_Control {
|
||||
* @since 3.4.0
|
||||
*/
|
||||
public function enqueue() {
|
||||
wp_enqueue_script( 'farbtastic' );
|
||||
wp_enqueue_style( 'farbtastic' );
|
||||
wp_enqueue_script( 'wp-color-picker' );
|
||||
wp_enqueue_style( 'wp-color-picker' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -372,19 +372,20 @@ class WP_Customize_Color_Control extends WP_Customize_Control {
|
||||
* @since 3.4.0
|
||||
*/
|
||||
public function render_content() {
|
||||
$this_default = $this->setting->default;
|
||||
$default_attr = '';
|
||||
if ( $this_default ) {
|
||||
if ( false === strpos( $this_default, '#' ) )
|
||||
$this_default = '#' . $this_default;
|
||||
$default_attr = ' data-default-color="' . esc_attr( $this_default ) . '"';
|
||||
}
|
||||
// The input's value gets set by JS. Don't fill it.
|
||||
?>
|
||||
<label>
|
||||
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
||||
<div class="customize-control-content">
|
||||
<div class="dropdown">
|
||||
<div class="dropdown-content">
|
||||
<div class="dropdown-status"></div>
|
||||
</div>
|
||||
<div class="dropdown-arrow"></div>
|
||||
</div>
|
||||
<input class="color-picker-hex" type="text" maxlength="7" placeholder="<?php esc_attr_e('Hex Value'); ?>" />
|
||||
<input class="color-picker-hex" type="text" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value' ); ?>"<?php echo $default_attr ?> />
|
||||
</div>
|
||||
<div class="farbtastic-placeholder"></div>
|
||||
</label>
|
||||
<?php
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user