<?php
/**
 * Theme Customizer Controls
 *
 * @package Kindergarten Art School
 */

if ( ! function_exists( 'kindergarten_art_school_customizer_global_color_setting_register' ) ) :
function kindergarten_art_school_customizer_global_color_setting_register( $wp_customize ) {
 
 	$wp_customize->add_section(
        'kindergarten_art_school_global_color_settings',
        array (
            'priority'      => 40,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Global Color Settings', 'kindergarten-art-school' )
        )
    );

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

	$wp_customize->add_control( 
		new Kindergarten_Art_School_Title_Info_Control( $wp_customize, 'kindergarten_art_school_theme_color_settings', 
		array(
		    'label'       => esc_html__( 'Global Color Settings', 'kindergarten-art-school' ),
		    'section'     => 'kindergarten_art_school_global_color_settings',
		    'type'        => 'kindergarten-art-school-title',
		    'settings'    => 'kindergarten_art_school_theme_color_settings',
		) 
	));

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

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
            $wp_customize,
            'kindergarten_art_school_global_color1',
            array(
                'label'      => esc_html__( 'Global Color1', 'kindergarten-art-school' ),
                'section'    => 'kindergarten_art_school_global_color_settings',
                'settings'   => 'kindergarten_art_school_global_color1',
            )
        )
    ); 

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

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
            $wp_customize,
            'kindergarten_art_school_global_color2',
            array(
                'label'      => esc_html__( 'Global Color2', 'kindergarten-art-school' ),
                'section'    => 'kindergarten_art_school_global_color_settings',
                'settings'   => 'kindergarten_art_school_global_color2',
            )
        )
    );   

}
endif;

add_action( 'customize_register', 'kindergarten_art_school_customizer_global_color_setting_register' );