<?php
/**
 * Theme Customizer Controls
 *
 * @package Quantic
 */

if ( ! function_exists( 'quantic_customizer_global_color_setting_register' ) ) :
function quantic_customizer_global_color_setting_register( $wp_customize ) {
 
 	$wp_customize->add_section(
        'quantic_global_color_settings',
        array (
            'priority'      => 40,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Global Color Settings', 'quantic' )
        )
    );

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

	$wp_customize->add_control( 
		new Quantic_Title_Info_Control( $wp_customize, 'quantic_theme_color_settings', 
		array(
		    'label'       => esc_html__( 'Global Color Settings', 'quantic' ),
		    'section'     => 'quantic_global_color_settings',
		    'type'        => 'quantic-title',
		    'settings'    => 'quantic_theme_color_settings',
		) 
	));

	$wp_customize->add_setting('quantic_global_color1',
        array(
            'type' => 'theme_mod',
            'default'           => '#2c627d',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
            $wp_customize,
            'quantic_global_color1',
            array(
                'label'      => esc_html__( 'Global Color1', 'quantic' ),
                'section'    => 'quantic_global_color_settings',
                'settings'   => 'quantic_global_color1',
            )
        )
    ); 

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

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
            $wp_customize,
            'quantic_global_color2',
            array(
                'label'      => esc_html__( 'Global Color2', 'quantic' ),
                'section'    => 'quantic_global_color_settings',
                'settings'   => 'quantic_global_color2',
            )
        )
    );   

}
endif;

add_action( 'customize_register', 'quantic_customizer_global_color_setting_register' );