Make WordPress Core


Ignore:
Timestamp:
10/25/2016 10:32:55 PM (9 years ago)
Author:
westonruter
Message:

Customize: Add hue-only mode to color picker.

The color control in the customizer can use the new mode by supplying the mode param with hue (as opposed to the new default full value). New control replaces the range control in Twenty Seventeen for colorscheme_hue. The wpColorPicker can opt for hue-only mode via supplying hue as the type option. Iris Color Picker is updated from v1.0.7 to v1.1.0-beta.

Props mattwiebe, celloexpressions.
Fixes #38263.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/inc/customizer.php

    r38850 r38931  
    4545    ) );
    4646
    47     $wp_customize->add_control( 'colorscheme_hue', array(
    48         'type'    => 'range',
    49         'input_attrs' => array(
    50             'min' => 0,
    51             'max' => 359,
    52             'step' => 1,
    53         ),
     47    $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'colorscheme_hue', array(
     48        'mode' => 'hue',
    5449        'section'  => 'colors',
    5550        'priority' => 6,
    56         'description' => 'Temporary hue slider will be replaced with a visual hue picker that is only shown when a custom scheme is selected', // temporary, intentionally untranslated.
    57         // @todo change this to a visual hue picker control, ideally extending the color control and leveraging iris by adding a `hue` mode in core.
    58         // See https://core.trac.wordpress.org/ticket/38263
    59         // @todo only show this control when the colorscheme is custom.
    60     ) );
     51    ) ) );
    6152
    6253    /**
Note: See TracChangeset for help on using the changeset viewer.