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

if ( ! function_exists( 'kindergarten_art_school_customizer_header_register' ) ) :
function kindergarten_art_school_customizer_header_register( $wp_customize ) {

    $wp_customize->add_section(
        'kindergarten_art_school_home_header_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Header Settings', 'kindergarten-art-school' )
        )
    );

    // Title label
    $wp_customize->add_setting( 
        'kindergarten_art_school_label_header_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_header_settings_title', 
        array(
            'label'       => esc_html__( 'Contact details', 'kindergarten-art-school' ),
            'section'     => 'kindergarten_art_school_home_header_settings',
            'type'        => 'kindergarten-art-school-title',
            'settings'    => 'kindergarten_art_school_label_header_settings_title',
        ) 
    ));

    // Phone Number
    $wp_customize->add_setting(
        'kindergarten_art_school_header_phone_number',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'kindergarten_art_school_header_phone_number',
        array(
            'label'           => sprintf( esc_html__( 'Phone Number', 'kindergarten-art-school' ), ),
            'section'         => 'kindergarten_art_school_home_header_settings',
            'settings'        => 'kindergarten_art_school_header_phone_number' ,
            'type'            => 'text',
        )
    );

    // email
    $wp_customize->add_setting(
        'kindergarten_art_school_header_email_id',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'kindergarten_art_school_header_email_id',
        array(
            'label'           => sprintf( esc_html__( 'Email Id', 'kindergarten-art-school' ), ),
            'section'         => 'kindergarten_art_school_home_header_settings',
            'settings'        => 'kindergarten_art_school_header_email_id' ,
            'type'            => 'text',
        )
    );

    // topbar buttons
    // Title label
    $wp_customize->add_setting( 
        'kindergarten_art_school_label_header_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_header_settings_title', 
        array(
            'label'       => esc_html__( 'Tobar Button', 'kindergarten-art-school' ),
            'section'     => 'kindergarten_art_school_home_header_settings',
            'type'        => 'kindergarten-art-school-title',
            'settings'    => 'kindergarten_art_school_label_header_settings_title',
        ) 
    ));

    $wp_customize->add_setting(
        'kindergarten_art_school_topbar_appointment_button_link',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'kindergarten_art_school_topbar_appointment_button_link',
        array(
            'label'           => sprintf( esc_html__( 'Topbar Appointment Button Link', 'kindergarten-art-school' ), ),
            'section'         => 'kindergarten_art_school_home_header_settings',
            'settings'        => 'kindergarten_art_school_topbar_appointment_button_link' ,
            'type'            => 'url',
        )
    );

    // Title label
    $wp_customize->add_setting( 
        'kindergarten_art_school_label_social_meida_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_social_meida_settings_title', 
        array(
            'label'       => esc_html__( 'Social Media Links', 'kindergarten-art-school' ),
            'section'     => 'kindergarten_art_school_home_header_settings',
            'type'        => 'kindergarten-art-school-title',
            'settings'    => 'kindergarten_art_school_label_social_meida_settings_title',
        ) 
    ));

    // Facebook Link
    $wp_customize->add_setting(
        'kindergarten_art_school_social_media1_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'kindergarten_art_school_social_media1_heading',
        array(
            'label'           => sprintf( esc_html__( 'Facebook Link', 'kindergarten-art-school' ), ),
            'section'         => 'kindergarten_art_school_home_header_settings',
            'settings'        => 'kindergarten_art_school_social_media1_heading' ,
            'type'            => 'url',
        )
    );

    // Instagram Link
    $wp_customize->add_setting(
        'kindergarten_art_school_social_media2_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'kindergarten_art_school_social_media2_heading',
        array(
            'label'           => sprintf( esc_html__( 'Instagram Link', 'kindergarten-art-school' ), ),
            'section'         => 'kindergarten_art_school_home_header_settings',
            'settings'        => 'kindergarten_art_school_social_media2_heading' ,
            'type'            => 'url',
        )
    );

    // Twitter Link
    $wp_customize->add_setting(
        'kindergarten_art_school_social_media3_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'kindergarten_art_school_social_media3_heading',
        array(
            'label'           => sprintf( esc_html__( 'Twitter Link', 'kindergarten-art-school' ), ),
            'section'         => 'kindergarten_art_school_home_header_settings',
            'settings'        => 'kindergarten_art_school_social_media3_heading' ,
            'type'            => 'url',
        )
    );

    // Youtube Link
    $wp_customize->add_setting(
        'kindergarten_art_school_social_media4_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'kindergarten_art_school_social_media4_heading',
        array(
            'label'           => sprintf( esc_html__( 'Youtube Link', 'kindergarten-art-school' ), ),
            'section'         => 'kindergarten_art_school_home_header_settings',
            'settings'        => 'kindergarten_art_school_social_media4_heading' ,
            'type'            => 'url',
        )
    );

    // Pinterest Link
    $wp_customize->add_setting(
        'kindergarten_art_school_social_media5_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'kindergarten_art_school_social_media5_heading',
        array(
            'label'           => sprintf( esc_html__( 'Pinterest Link', 'kindergarten-art-school' ), ),
            'section'         => 'kindergarten_art_school_home_header_settings',
            'settings'        => 'kindergarten_art_school_social_media5_heading' ,
            'type'            => 'url',
        )
    );

    // Linkedin Link
    $wp_customize->add_setting(
        'kindergarten_art_school_social_media6_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'kindergarten_art_school_social_media6_heading',
        array(
            'label'           => sprintf( esc_html__( 'Linkedin Link', 'kindergarten-art-school' ), ),
            'section'         => 'kindergarten_art_school_home_header_settings',
            'settings'        => 'kindergarten_art_school_social_media6_heading' ,
            'type'            => 'url',
        )
    );
    
}
endif;

add_action( 'customize_register', 'kindergarten_art_school_customizer_header_register' );