<?php
/**
 * Theme Customizer Controls
 *
 * @package Home Shifting Services
 */

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

    $wp_customize->add_section(
        'home_shifting_services_home_header_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Header Settings', 'home-shifting-services' )
        )
    );
    
    // Title label
    $wp_customize->add_setting( 
        'home_shifting_services_label_social_meida_settings_title', 
        array(
            'sanitize_callback' => 'home_shifting_services_sanitize_title',
        ) 
    );

    $wp_customize->add_control( 
        new Home_Shifting_Services_Title_Info_Control( $wp_customize, 'home_shifting_services_label_social_meida_settings_title', 
        array(
            'label'       => esc_html__( 'Social Media Links', 'home-shifting-services' ),
            'section'     => 'home_shifting_services_home_header_settings',
            'type'        => 'home-shifting-services-title',
            'settings'    => 'home_shifting_services_label_social_meida_settings_title',
        ) 
    ));

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

    $wp_customize->add_control(
        'home_shifting_services_social_media1_heading',
        array(
            'label'           => sprintf( esc_html__( 'Facebook Link', 'home-shifting-services' ), ),
            'section'         => 'home_shifting_services_home_header_settings',
            'settings'        => 'home_shifting_services_social_media1_heading' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control(
        'home_shifting_services_social_media2_heading',
        array(
            'label'           => sprintf( esc_html__( 'Instagram Link', 'home-shifting-services' ), ),
            'section'         => 'home_shifting_services_home_header_settings',
            'settings'        => 'home_shifting_services_social_media2_heading' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control(
        'home_shifting_services_social_media3_heading',
        array(
            'label'           => sprintf( esc_html__( 'Twitter Link', 'home-shifting-services' ), ),
            'section'         => 'home_shifting_services_home_header_settings',
            'settings'        => 'home_shifting_services_social_media3_heading' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control(
        'home_shifting_services_social_media4_heading',
        array(
            'label'           => sprintf( esc_html__( 'Youtube Link', 'home-shifting-services' ), ),
            'section'         => 'home_shifting_services_home_header_settings',
            'settings'        => 'home_shifting_services_social_media4_heading' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control(
        'home_shifting_services_social_media5_heading',
        array(
            'label'           => sprintf( esc_html__( 'Pinterest Link', 'home-shifting-services' ), ),
            'section'         => 'home_shifting_services_home_header_settings',
            'settings'        => 'home_shifting_services_social_media5_heading' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control(
        'home_shifting_services_social_media6_heading',
        array(
            'label'           => sprintf( esc_html__( 'Linkedin Link', 'home-shifting-services' ), ),
            'section'         => 'home_shifting_services_home_header_settings',
            'settings'        => 'home_shifting_services_social_media6_heading' ,
            'type'            => 'url',
        )
    );

    // topbar buttons
    // Title label
    $wp_customize->add_setting( 
        'home_shifting_services_topbar_button_settings_title', 
        array(
            'sanitize_callback' => 'home_shifting_services_sanitize_title',
        ) 
    );

    $wp_customize->add_control( 
        new Home_Shifting_Services_Title_Info_Control( $wp_customize, 'home_shifting_services_topbar_button_settings_title', 
        array(
            'label'       => esc_html__( 'Topbar Buttons', 'home-shifting-services' ),
            'section'     => 'home_shifting_services_home_header_settings',
            'type'        => 'home-shifting-services-title',
            'settings'    => 'home_shifting_services_topbar_button_settings_title',
        ) 
    ));

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

    $wp_customize->add_control(
        'home_shifting_services_topbar_button_link',
        array(
            'label'           => sprintf( esc_html__( 'Newsletter Button Link', 'home-shifting-services' ), ),
            'section'         => 'home_shifting_services_home_header_settings',
            'settings'        => 'home_shifting_services_topbar_button_link' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control(
        'home_shifting_services_topbar_career_button_link',
        array(
            'label'           => sprintf( esc_html__( 'Career Button Link', 'home-shifting-services' ), ),
            'section'         => 'home_shifting_services_home_header_settings',
            'settings'        => 'home_shifting_services_topbar_career_button_link' ,
            'type'            => 'url',
        )
    );


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

    $wp_customize->add_control( 
        new Home_Shifting_Services_Title_Info_Control( $wp_customize, 'home_shifting_services_label_header_settings_title', 
        array(
            'label'       => esc_html__( 'Contact Detail', 'home-shifting-services' ),
            'section'     => 'home_shifting_services_home_header_settings',
            'type'        => 'home-shifting-services-title',
            'settings'    => 'home_shifting_services_label_header_settings_title',
        ) 
    ));

    $wp_customize->add_setting(
        'home_shifting_services_topbar_phone_number',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'home_shifting_services_topbar_phone_number',
        array(
            'label'           => sprintf( esc_html__( 'Phone Number', 'home-shifting-services' ), ),
            'section'         => 'home_shifting_services_home_header_settings',
            'settings'        => 'home_shifting_services_topbar_phone_number' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
        'home_shifting_services_topbar_address',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'home_shifting_services_topbar_address',
        array(
            'label'           => sprintf( esc_html__( 'Address', 'home-shifting-services' ), ),
            'section'         => 'home_shifting_services_home_header_settings',
            'settings'        => 'home_shifting_services_topbar_address' ,
            'type'            => 'text',
        )
    );

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

    $wp_customize->add_control( 
        new Home_Shifting_Services_Title_Info_Control( $wp_customize, 'home_shifting_services_label_header_search_settings_title', 
        array(
            'label'       => esc_html__( 'Search Bar', 'home-shifting-services' ),
            'section'     => 'home_shifting_services_home_header_settings',
            'type'        => 'home-shifting-services-title',
            'settings'    => 'home_shifting_services_label_header_search_settings_title',
        ) 
    ));

     // Hide Search bar
    $wp_customize->add_setting(
        'home_shifting_services_search_hide',
        array(
            'type' => 'theme_mod',
            'default'           => false,
            'sanitize_callback' => 'home_shifting_services_sanitize_checkbox'
        )
    );

    $wp_customize->add_control(
        new Home_Shifting_Services_Toggle_Control( $wp_customize, 'home_shifting_services_search_hide', 
        array(
            'settings'      => 'home_shifting_services_search_hide',
            'section'       => 'home_shifting_services_home_header_settings',
            'type'          => 'home-shifting-services-toggle',
            'label'         => esc_html__( 'Show\Hide Search', 'home-shifting-services' ),
            'description'   => '',           
        )
    ));
    
     // header Button
    $wp_customize->add_setting(
        'home_shifting_services_header_button_link',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'home_shifting_services_header_button_link',
        array(
            'label'           => sprintf( esc_html__( 'Header Button Link', 'home-shifting-services' ), ),
            'section'         => 'home_shifting_services_home_header_settings',
            'settings'        => 'home_shifting_services_header_button_link' ,
            'type'            => 'url',
        )
    );
}
endif;

add_action( 'customize_register', 'home_shifting_services_customizer_header_register' );