<?php
/**
 * Theme Customizer Controls
 *
 * @package Business Article Ship
 */


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

    $wp_customize->add_section(
        'business_article_ship_home_header_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Header Settings', 'business-article-ship' )
        )
    );

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

    $wp_customize->add_control(
        'business_article_ship_topbar_text',
        array(
            'label'           => sprintf( esc_html__( 'Topbar Text', 'business-article-ship' ), ),
            'section'         => 'business_article_ship_home_header_settings',
            'settings'        => 'business_article_ship_topbar_text' ,
            'type'            => 'text',
        )
    );


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

    $wp_customize->add_control( 
        new Business_Article_Ship_Title_Info_Control( $wp_customize, 'business_article_ship_label_header_settings_title', 
        array(
            'label'       => esc_html__( 'Tobar Buttons', 'business-article-ship' ),
            'section'     => 'business_article_ship_home_header_settings',
            'type'        => 'business-article-ship-title',
            'settings'    => 'business_article_ship_label_header_settings_title',
        ) 
    ));

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

    $wp_customize->add_control(
        'business_article_ship_topbar_career_button_link',
        array(
            'label'           => sprintf( esc_html__( 'Topbar Careers Button Link', 'business-article-ship' ), ),
            'section'         => 'business_article_ship_home_header_settings',
            'settings'        => 'business_article_ship_topbar_career_button_link' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control(
        'business_article_ship_topbar_service_button_link',
        array(
            'label'           => sprintf( esc_html__( 'Services Button Link', 'business-article-ship' ), ),
            'section'         => 'business_article_ship_home_header_settings',
            'settings'        => 'business_article_ship_topbar_service_button_link' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control(
        'business_article_ship_topbar_contact_button_link',
        array(
            'label'           => sprintf( esc_html__( 'Contact Button Link', 'business-article-ship' ), ),
            'section'         => 'business_article_ship_home_header_settings',
            'settings'        => 'business_article_ship_topbar_contact_button_link' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control( 
        new Business_Article_Ship_Title_Info_Control( $wp_customize, 'business_article_ship_label_social_meida_settings_title', 
        array(
            'label'       => esc_html__( 'Social Media Links', 'business-article-ship' ),
            'section'     => 'business_article_ship_home_header_settings',
            'type'        => 'business-article-ship-title',
            'settings'    => 'business_article_ship_label_social_meida_settings_title',
        ) 
    ));

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

    $wp_customize->add_control(
        'business_article_ship_social_media1_heading',
        array(
            'label'           => sprintf( esc_html__( 'Facebook Link', 'business-article-ship' ), ),
            'section'         => 'business_article_ship_home_header_settings',
            'settings'        => 'business_article_ship_social_media1_heading' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control(
        'business_article_ship_social_media2_heading',
        array(
            'label'           => sprintf( esc_html__( 'Instagram Link', 'business-article-ship' ), ),
            'section'         => 'business_article_ship_home_header_settings',
            'settings'        => 'business_article_ship_social_media2_heading' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control(
        'business_article_ship_social_media3_heading',
        array(
            'label'           => sprintf( esc_html__( 'Twitter Link', 'business-article-ship' ), ),
            'section'         => 'business_article_ship_home_header_settings',
            'settings'        => 'business_article_ship_social_media3_heading' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control(
        'business_article_ship_social_media4_heading',
        array(
            'label'           => sprintf( esc_html__( 'Youtube Link', 'business-article-ship' ), ),
            'section'         => 'business_article_ship_home_header_settings',
            'settings'        => 'business_article_ship_social_media4_heading' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control(
        'business_article_ship_social_media5_heading',
        array(
            'label'           => sprintf( esc_html__( 'Pinterest Link', 'business-article-ship' ), ),
            'section'         => 'business_article_ship_home_header_settings',
            'settings'        => 'business_article_ship_social_media5_heading' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control(
        'business_article_ship_social_media6_heading',
        array(
            'label'           => sprintf( esc_html__( 'Linkedin Link', 'business-article-ship' ), ),
            'section'         => 'business_article_ship_home_header_settings',
            'settings'        => 'business_article_ship_social_media6_heading' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control( 
        new Business_Article_Ship_Title_Info_Control( $wp_customize, 'business_article_ship_label_header_search_settings_title', 
        array(
            'label'       => esc_html__( 'Search Bar', 'business-article-ship' ),
            'section'     => 'business_article_ship_home_header_settings',
            'type'        => 'business-article-ship-title',
            'settings'    => 'business_article_ship_label_header_search_settings_title',
        ) 
    ));

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

    $wp_customize->add_control(
        new Business_Article_Ship_Toggle_Control( $wp_customize, 'business_article_ship_search_hide', 
        array(
            'settings'      => 'business_article_ship_search_hide',
            'section'       => 'business_article_ship_home_header_settings',
            'type'          => 'business-article-ship-toggle',
            'label'         => esc_html__( 'Show\Hide Search', 'business-article-ship' ),
            'description'   => '',           
        )
    ));

}
endif;

add_action( 'customize_register', 'business_article_ship_customizer_header_register' );