<?php
/**
 * Theme Customizer Controls
 *
 * @package Corporate Businessmen
 */

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

    $wp_customize->add_section(
        'corporate_businessmen_home_header_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Header Settings', 'corporate-businessmen' )
        )
    );
    
    // Title label
    $wp_customize->add_setting( 
        'corporate_businessmen_label_social_meida_settings_title', 
        array(
            'sanitize_callback' => 'corporate_businessmen_sanitize_title',
        ) 
    );

    $wp_customize->add_control( 
        new Corporate_Businessmen_Title_Info_Control( $wp_customize, 'corporate_businessmen_label_social_meida_settings_title', 
        array(
            'label'       => esc_html__( 'Social Media Links', 'corporate-businessmen' ),
            'section'     => 'corporate_businessmen_home_header_settings',
            'type'        => 'corporate-businessmen-title',
            'settings'    => 'corporate_businessmen_label_social_meida_settings_title',
        ) 
    ));

    // Facebook Link
    $wp_customize->add_setting(
        'corporate_businessmen_social_media1_heading',
        array(
            'default'           => 'www.facebook.com',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'corporate_businessmen_social_media1_heading',
        array(
            'label'           => sprintf( esc_html__( 'Facebook Link', 'corporate-businessmen' ), ),
            'section'         => 'corporate_businessmen_home_header_settings',
            'settings'        => 'corporate_businessmen_social_media1_heading' ,
            'type'            => 'url',
        )
    );

    // Instagram Link
    $wp_customize->add_setting(
        'corporate_businessmen_social_media2_heading',
        array(
            'default'           => 'www.instagram.com',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'corporate_businessmen_social_media2_heading',
        array(
            'label'           => sprintf( esc_html__( 'Instagram Link', 'corporate-businessmen' ), ),
            'section'         => 'corporate_businessmen_home_header_settings',
            'settings'        => 'corporate_businessmen_social_media2_heading' ,
            'type'            => 'url',
        )
    );

    // Twitter Link
    $wp_customize->add_setting(
        'corporate_businessmen_social_media3_heading',
        array(
            'default'           => 'www.twitter.com',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'corporate_businessmen_social_media3_heading',
        array(
            'label'           => sprintf( esc_html__( 'Twitter Link', 'corporate-businessmen' ), ),
            'section'         => 'corporate_businessmen_home_header_settings',
            'settings'        => 'corporate_businessmen_social_media3_heading' ,
            'type'            => 'url',
        )
    );

    // Youtube Link
    $wp_customize->add_setting(
        'corporate_businessmen_social_media4_heading',
        array(
            'default'           => 'www.youtube.com',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'corporate_businessmen_social_media4_heading',
        array(
            'label'           => sprintf( esc_html__( 'Youtube Link', 'corporate-businessmen' ), ),
            'section'         => 'corporate_businessmen_home_header_settings',
            'settings'        => 'corporate_businessmen_social_media4_heading' ,
            'type'            => 'url',
        )
    );

    // Pinterest Link
    $wp_customize->add_setting(
        'corporate_businessmen_social_media5_heading',
        array(
            'default'           => 'www.pinterest.com',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'corporate_businessmen_social_media5_heading',
        array(
            'label'           => sprintf( esc_html__( 'Pinterest Link', 'corporate-businessmen' ), ),
            'section'         => 'corporate_businessmen_home_header_settings',
            'settings'        => 'corporate_businessmen_social_media5_heading' ,
            'type'            => 'url',
        )
    );

    // Linkedin Link
    $wp_customize->add_setting(
        'corporate_businessmen_social_media6_heading',
        array(
            'default'           => 'www.linkedin.com',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'corporate_businessmen_social_media6_heading',
        array(
            'label'           => sprintf( esc_html__( 'Linkedin Link', 'corporate-businessmen' ), ),
            'section'         => 'corporate_businessmen_home_header_settings',
            'settings'        => 'corporate_businessmen_social_media6_heading' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control( 
        new Corporate_Businessmen_Title_Info_Control( $wp_customize, 'corporate_businessmen_label_header_settings_title', 
        array(
            'label'       => esc_html__( 'Contact Detail', 'corporate-businessmen' ),
            'section'     => 'corporate_businessmen_home_header_settings',
            'type'        => 'corporate-businessmen-title',
            'settings'    => 'corporate_businessmen_label_header_settings_title',
        ) 
    ));

    $wp_customize->add_setting(
        'corporate_businessmen_topbar_address',
        array(
            'default'           => '775 Rolling Green Rd.',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'corporate_businessmen_topbar_address',
        array(
            'label'           => sprintf( esc_html__( 'Address', 'corporate-businessmen' ), ),
            'section'         => 'corporate_businessmen_home_header_settings',
            'settings'        => 'corporate_businessmen_topbar_address' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
        'corporate_businessmen_topbar_phone_no',
        array(
            'default'           => '+088 235 235 427',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'corporate_businessmen_topbar_phone_no',
        array(
            'label'           => sprintf( esc_html__( 'Contact No', 'corporate-businessmen' ), ),
            'section'         => 'corporate_businessmen_home_header_settings',
            'settings'        => 'corporate_businessmen_topbar_phone_no' ,
            'type'            => 'text',
        )
    );


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

    $wp_customize->add_control( 
        new Corporate_Businessmen_Title_Info_Control( $wp_customize, 'corporate_businessmen_label_header_search_settings_title', 
        array(
            'label'       => esc_html__( 'Search Bar', 'corporate-businessmen' ),
            'section'     => 'corporate_businessmen_home_header_settings',
            'type'        => 'corporate-businessmen-title',
            'settings'    => 'corporate_businessmen_label_header_search_settings_title',
        ) 
    ));

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

    $wp_customize->add_control(
        new Corporate_Businessmen_Toggle_Control( $wp_customize, 'corporate_businessmen_search_hide', 
        array(
            'settings'      => 'corporate_businessmen_search_hide',
            'section'       => 'corporate_businessmen_home_header_settings',
            'type'          => 'corporate-businessmen-toggle',
            'label'         => esc_html__( 'Show\Hide Search', 'corporate-businessmen' ),
            'description'   => '',           
        )
    ));
    
     // header Button
    $wp_customize->add_setting(
        'corporate_businessmen_header_button_link',
        array(
            'default'           => '#',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'corporate_businessmen_header_button_link',
        array(
            'label'           => sprintf( esc_html__( 'Header Button Link', 'corporate-businessmen' ), ),
            'section'         => 'corporate_businessmen_home_header_settings',
            'settings'        => 'corporate_businessmen_header_button_link' ,
            'type'            => 'url',
        )
    );
}
endif;

add_action( 'customize_register', 'corporate_businessmen_customizer_header_register' );