Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* Colors controls.
*
* @since 1.0.0
*
* @param WP_Customize_Manager $wp_customize The Customizer object.
*/
function bigbox_customize_register_colors_controls( $wp_customize ) {
$wp_customize->add_setting(
$key, [
'default' => '#fff000',
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_hex_color',
]
);
$wp_customize->add_control(
new BigBox\Customize\WP_Customize_Color_Control(
$wp_customize,
$key,
[
'label' => 'Some Color',
'section' => 'colors-palette',
'palettes' => [ '#fff000', '#ff0000' ],
]
)
);
}
add_action( 'customize_register', 'bigbox_customize_register_colors_controls', 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.