<?php
function hotel_26_header_settings( $wp_customize ) {
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
	/*=========================================
	Header Settings Panel
	=========================================*/
	$wp_customize->add_panel( 
		'header_section', 
		array(
			'priority'      => 2,
			'capability'    => 'edit_theme_options',
			'title'			=> __('Header', 'hotel-26'),
		) 
	);
	
	/*=========================================
	Hotel 26 Site Identity
	=========================================*/
	$wp_customize->add_section(
        'title_tagline',
        array(
        	'priority'      => 1,
            'title' 		=> __('Site Identity','hotel-26'),
			'panel'  		=> 'header_section',
		)
    );

	/*=========================================
	Header Navigation
	=========================================*/	
	$wp_customize->add_section(
        'header_navigation',
        array(
        	'priority'      => 4,
            'title' 		=> __('Header Navigation','hotel-26'),
			'panel'  		=> 'header_section',
		)
    );
	
	// Search
	$wp_customize->add_setting(
		'hdr_nav_search'
			,array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'hotel_26_sanitize_text',
			'priority' => 1,
		)
	);

	$wp_customize->add_control(
	'hdr_nav_search',
		array(
			'type' => 'hidden',
			'label' => __('Search','hotel-26'),
			'section' => 'header_navigation',
		)
	);
	$wp_customize->add_setting( 
		'hide_show_search' , 
			array(
			'default' => '1',
			'capability'     => 'edit_theme_options',
			'sanitize_callback' => 'hotel_26_sanitize_checkbox',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'hide_show_search', 
		array(
			'label'	      => esc_html__( 'Hide/Show', 'hotel-26' ),
			'section'     => 'header_navigation',
			'type'        => 'checkbox'
		) 
	);	
		
	// Button
	$wp_customize->add_setting(
		'hdr_btn'
			,array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'hotel_26_sanitize_text',
			'priority' => 1,
		)
	);

	$wp_customize->add_control(
	'hdr_btn',
		array(
			'type' => 'hidden',
			'label' => __('Button','hotel-26'),
			'section' => 'header_navigation',
		)
	);
	$wp_customize->add_setting( 
		'hdr_nav_btn_lbl' , 
			array(
			'capability'     => 'edit_theme_options',
			'sanitize_callback' => 'hotel_26_sanitize_text',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'hdr_nav_btn_lbl', 
		array(
			'label'	      => esc_html__( 'Button Label', 'hotel-26' ),
			'section'     => 'header_navigation',
			'type'        => 'text'
		) 
	);
	$wp_customize->add_setting( 
		'nav_nav_btn_link' , 
			array(
			'capability'     => 'edit_theme_options',
			'sanitize_callback' => 'hotel_26_sanitize_text',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'nav_nav_btn_link', 
		array(
			'label'	      => esc_html__( 'Button Link', 'hotel-26' ),
			'section'     => 'header_navigation',
			'type'        => 'text'
		) 
	);
	$wp_customize->add_setting( 
		'hdr_nav_btn_newtab' , 
			array(
			'capability'     => 'edit_theme_options',
			'sanitize_callback' => 'hotel_26_sanitize_checkbox',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'hdr_nav_btn_newtab', 
		array(
			'label'	      => esc_html__( 'Open Link Newtab', 'hotel-26' ),
			'section'     => 'header_navigation',
			'type'        => 'checkbox'
		) 
	);	
	
	$wp_customize->add_setting( 
		'hdr_nav_btn_nofollow' , 
			array(
			'capability'     => 'edit_theme_options',
			'sanitize_callback' => 'hotel_26_sanitize_checkbox',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'hdr_nav_btn_nofollow', 
		array(
			'label'	      => esc_html__( 'Add "nofollow" to Link', 'hotel-26' ),
			'section'     => 'header_navigation',
			'type'        => 'checkbox'
		) 
	);	
		
	/*=========================================
	Sticky Header
	=========================================*/	
	$wp_customize->add_section(
        'sticky_header_set',
        array(
        	'priority'      => 4,
            'title' 		=> __('Sticky Header','hotel-26'),
			'panel'  		=> 'header_section',
		)
    );
	
	// Heading
	$wp_customize->add_setting(
		'sticky_head'
			,array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'hotel_26_sanitize_text',
			'priority' => 1,
		)
	);

	$wp_customize->add_control(
	'sticky_head',
		array(
			'type' => 'hidden',
			'label' => __('Sticky Header','hotel-26'),
			'section' => 'sticky_header_set',
		)
	);
	$wp_customize->add_setting( 
		'hide_show_sticky' , 
			array(
			// 'default' => '1',
			'capability'     => 'edit_theme_options',
			'sanitize_callback' => 'hotel_26_sanitize_checkbox',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'hide_show_sticky', 
		array(
			'label'	      => esc_html__( 'Hide/Show', 'hotel-26' ),
			'section'     => 'sticky_header_set',
			'type'        => 'checkbox'
		) 
	);	
}
add_action( 'customize_register', 'hotel_26_header_settings' );
