<?php
/**
 * Theme Customizer Controls
 *
 * @package Unique Gift Shop
 */

if ( ! function_exists( 'unique_gift_shop_customizer_global_color_setting_register' ) ) :
function unique_gift_shop_customizer_global_color_setting_register( $wp_customize ) {
 
 	$wp_customize->add_section(
        'unique_gift_shop_global_color_settings',
        array (
            'priority'      => 40,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Global Color Settings', 'unique-gift-shop' )
        )
    );

    // Title label
	$wp_customize->add_setting( 
		'unique_gift_shop_theme_color_settings', 
		array(
		    'sanitize_callback' => 'unique_gift_shop_sanitize_title',
		) 
	);

	$wp_customize->add_control( 
		new Unique_Gift_Shop_Title_Info_Control( $wp_customize, 'unique_gift_shop_theme_color_settings', 
		array(
		    'label'       => esc_html__( 'Global Color Settings', 'unique-gift-shop' ),
		    'section'     => 'unique_gift_shop_global_color_settings',
		    'type'        => 'unique-gift-shop-title',
		    'settings'    => 'unique_gift_shop_theme_color_settings',
		) 
	));

    $wp_customize->add_setting('unique_gift_shop_global_color1',
        array(
            'type' => 'theme_mod',
            'default'           => '#BB9365',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
            $wp_customize,
            'unique_gift_shop_global_color1',
            array(
                'label'      => esc_html__( 'Global Color1', 'unique-gift-shop' ),
                'section'    => 'unique_gift_shop_global_color_settings',
                'settings'   => 'unique_gift_shop_global_color1',
            )
        )
    ); 

    $wp_customize->add_setting('unique_gift_shop_global_color2',
        array(
            'type' => 'theme_mod',
            'default'           => '#EFCCCA',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
            $wp_customize,
            'unique_gift_shop_global_color2',
            array(
                'label'      => esc_html__( 'Global Color2', 'unique-gift-shop' ),
                'section'    => 'unique_gift_shop_global_color_settings',
                'settings'   => 'unique_gift_shop_global_color2',
            )
        )
    );  

    $wp_customize->add_setting('unique_gift_shop_global_color3',
        array(
            'type' => 'theme_mod',
            'default'           => '#F8B3B3',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
            $wp_customize,
            'unique_gift_shop_global_color3',
            array(
                'label'      => esc_html__( 'Global Color3', 'unique-gift-shop' ),
                'section'    => 'unique_gift_shop_global_color_settings',
                'settings'   => 'unique_gift_shop_global_color3',
            )
        )
    );   

}
endif;

add_action( 'customize_register', 'unique_gift_shop_customizer_global_color_setting_register' );