<?php
/**
 * Theme Customizer Controls
 *
 * @package Unique Gift Shop
 */


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

    $wp_customize->add_section(
        'unique_gift_shop_home_header_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Header Settings', 'unique-gift-shop' )
        )
    );

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

    $wp_customize->add_control( 
        new Unique_Gift_Shop_Title_Info_Control( $wp_customize, 'unique_gift_shop_label_header_search_settings_title', 
        array(
            'label'       => esc_html__( 'Search Bar', 'unique-gift-shop' ),
            'section'     => 'unique_gift_shop_home_header_settings',
            'type'        => 'unique-gift-shop-title',
            'settings'    => 'unique_gift_shop_label_header_search_settings_title',
        ) 
    ));

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

    $wp_customize->add_control(
        new Unique_Gift_Shop_Toggle_Control( $wp_customize, 'unique_gift_shop_search_hide', 
        array(
            'settings'      => 'unique_gift_shop_search_hide',
            'section'       => 'unique_gift_shop_home_header_settings',
            'type'          => 'unique-gift-shop-toggle',
            'label'         => esc_html__( 'Show\Hide Search', 'unique-gift-shop' ),
            'description'   => '',           
        )
    ));

}
endif;

add_action( 'customize_register', 'unique_gift_shop_customizer_header_register' );