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

if ( ! function_exists( 'kindergarten_art_school_customizer_home_banner_register' ) ) :
function kindergarten_art_school_customizer_home_banner_register( $wp_customize ) {
 	
 	$wp_customize->add_section(
        'kindergarten_art_school_home_banner_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Banner Settings', 'kindergarten-art-school' )
        )
    );

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

	$wp_customize->add_control( 
		new Kindergarten_Art_School_Title_Info_Control( $wp_customize, 'kindergarten_art_school_label_banner_settings_title', 
		array(
		    'label'       => esc_html__( 'Banner Settings', 'kindergarten-art-school' ),
		    'section'     => 'kindergarten_art_school_home_banner_settings',
		    'type'        => 'kindergarten-art-school-title',
		    'settings'    => 'kindergarten_art_school_label_banner_settings_title',
		) 
	));

    // Button Image
    $wp_customize->add_setting(
        'kindergarten_art_school_banner_right_image',
        array(
            'default'           => '',
            'sanitize_callback' => 'kindergarten_art_school_sanitize_image',

        )
    );
    
    $wp_customize->add_control(
        new WP_Customize_Image_Control(
            $wp_customize, 'kindergarten_art_school_banner_right_image', 
            array(
                'label'           => sprintf( esc_html__( 'Banner Right Image', 'kindergarten-art-school' ), ),
                'settings'  => 'kindergarten_art_school_banner_right_image',
                'section'   => 'kindergarten_art_school_home_banner_settings'
            ) 
        )
    );

    // Banner Heading
    $wp_customize->add_setting(
        'kindergarten_art_school_banner_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'kindergarten_art_school_banner_heading',
        array(
            'label'           => sprintf( esc_html__( 'Banner Heading', 'kindergarten-art-school' ), ),
            'section'         => 'kindergarten_art_school_home_banner_settings',
            'settings'        => 'kindergarten_art_school_banner_heading' ,
            'type'            => 'text',
        )
    );

    // Banner sm-hd
    $wp_customize->add_setting(
        'kindergarten_art_school_banner_small_head',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'kindergarten_art_school_banner_small_head',
        array(
            'label'           => sprintf( esc_html__( 'Banner Small Heading', 'kindergarten-art-school' ), ),
            'section'         => 'kindergarten_art_school_home_banner_settings',
            'settings'        => 'kindergarten_art_school_banner_small_head' ,
            'type'            => 'text',
        )
    );

    // Banner text
    $wp_customize->add_setting(
        'kindergarten_art_school_banner_text',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'kindergarten_art_school_banner_text',
        array(
            'label'           => sprintf( esc_html__( 'Banner Text', 'kindergarten-art-school' ), ),
            'section'         => 'kindergarten_art_school_home_banner_settings',
            'settings'        => 'kindergarten_art_school_banner_text' ,
            'type'            => 'text',
        )
    );

    // button
    $wp_customize->add_setting(
        'kindergarten_art_school_banner_button_link',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'kindergarten_art_school_banner_button_link',
        array(
            'label'           => sprintf( esc_html__( 'Banner Button Link', 'kindergarten-art-school' ), ),
            'section'         => 'kindergarten_art_school_home_banner_settings',
            'settings'        => 'kindergarten_art_school_banner_button_link' ,
            'type'            => 'url',
        )
    );

    // Slider Content Alignment Setting
    $wp_customize->add_setting(
        'kindergarten_art_school_slider_content_alignment',
        array(
            'default'           => 'left',
            'sanitize_callback' => 'kindergarten_art_school_sanitize_select',
        )
    );

    $wp_customize->add_control(
        'kindergarten_art_school_slider_content_alignment',
        array(
            'label'    => esc_html__( 'Slider Content Alignment', 'kindergarten-art-school' ),
            'section'  => 'kindergarten_art_school_home_banner_settings',
            'settings' => 'kindergarten_art_school_slider_content_alignment',
            'type'     => 'select',
            'choices'  => array(
                'left'   => esc_html__( 'Left', 'kindergarten-art-school' ),
                'center' => esc_html__( 'Center', 'kindergarten-art-school' ),
                'right'  => esc_html__( 'Right', 'kindergarten-art-school' ),
            ),
        )
    );
}
endif;

add_action( 'customize_register', 'kindergarten_art_school_customizer_home_banner_register' );