Skip to content

Instantly share code, notes, and snippets.

View Tursunboyeev's full-sized avatar

Abduaziz Tursunboyev Tursunboyeev

View GitHub Profile
@ajskelton
ajskelton / WP Customizer - Color Control
Last active July 17, 2020 05:05
Add a Color Control field to the WordPress Customizer.
$wp_customize->add_setting( 'core_color_setting_id', array(
'sanitize_callback' => 'themeslug_sanitize_hex_color',
) );
$wp_customize->add_control(
new WP_Customize_Color_Control( $wp_customize, 'core_color_setting_id',
array(
'label' => __( 'Core Color Setting' ),
'description' => __( 'Select a color for something' ),
'section' => 'custom_section', // Add a default or your own section