<?php
/**
 * Header Layout Settings
 *
 * @package chic-lifestyle
 */

add_action( 'customize_register', 'chic_lifestyle_header_search_section' );

function chic_lifestyle_header_search_section( $wp_customize ) {

    $wp_customize->add_section( 'chic_lifestyle_header_search_section', array(
        'title'          => esc_html__( 'Header Search', 'chic-lifestyle' ),
        'panel'          => 'chic_lifestyle_header_panel',
        'priority'       => 3,
        'capability'     => 'edit_theme_options',
    ) );

    $wp_customize->add_setting( 'chic_lifestyle_header_search_display_option', array(
        'sanitize_callback'     =>  'chic_lifestyle_sanitize_checkbox',
        'default'               =>  true
    ) );
            
    $wp_customize->add_control( new Chic_Lifestyle_Toggle_Control(
        $wp_customize, 'chic_lifestyle_header_search_display_option', array(
            'label' => esc_html__( 'Hide / Show Header Search','chic-lifestyle' ),
            'section' => 'chic_lifestyle_header_search_section',
            'settings' => 'chic_lifestyle_header_search_display_option',
            'type'=> 'toggle',
            )
    ) );

    $wp_customize->selective_refresh->add_partial('chic_lifestyle_header_search_display_option', array(
        'selector' => '#chic_lifestyle_header_search_section'
    ));

}