<?php
/**
 * Theme Customizer Controls
 *
 * @package Jungle Eco Tours
 */

if ( ! function_exists( 'jungle_eco_tours_customizer_global_color_setting_register' ) ) :
function jungle_eco_tours_customizer_global_color_setting_register( $wp_customize ) {
 
 	$wp_customize->add_section(
        'jungle_eco_tours_global_color_settings',
        array (
            'priority'      => 40,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Global Color Settings', 'jungle-eco-tours' )
        )
    );

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

	$wp_customize->add_control( 
		new Jungle_Eco_Tours_Title_Info_Control( $wp_customize, 'jungle_eco_tours_theme_color_settings', 
		array(
		    'label'       => esc_html__( 'Global Color Settings', 'jungle-eco-tours' ),
		    'section'     => 'jungle_eco_tours_global_color_settings',
		    'type'        => 'jungle-eco-tours-title',
		    'settings'    => 'jungle_eco_tours_theme_color_settings',
		) 
	));

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

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
            $wp_customize,
            'jungle_eco_tours_global_color1',
            array(
                'label'      => esc_html__( 'Global Color1', 'jungle-eco-tours' ),
                'section'    => 'jungle_eco_tours_global_color_settings',
                'settings'   => 'jungle_eco_tours_global_color1',
            )
        )
    ); 

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

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
            $wp_customize,
            'jungle_eco_tours_global_color2',
            array(
                'label'      => esc_html__( 'Global Color2', 'jungle-eco-tours' ),
                'section'    => 'jungle_eco_tours_global_color_settings',
                'settings'   => 'jungle_eco_tours_global_color2',
            )
        )
    );   

}
endif;

add_action( 'customize_register', 'jungle_eco_tours_customizer_global_color_setting_register' );