<?php
function expert_makeup_stylist_sidebar_setting( $wp_customize ) {
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
	$wp_customize->add_panel(
		'expert_makeup_stylist_sidebar', array(
			'priority' => 31,
			'title' => esc_html__( 'Sidebar Options', 'expert-makeup-stylist' ),
		)
	);

	/*=========================================
	Sidebar Option  Section
	=========================================*/
	$wp_customize->add_section(
		'expert_makeup_stylist_sidebar_settings', array(
			'title' => esc_html__( 'Sidebar Options', 'expert-makeup-stylist' ),
			'priority' => 1,
			'panel' => 'expert_makeup_stylist_general',
		)
	);
	

	// Archive Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_makeup_stylist_archive_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_makeup_stylist_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_makeup_stylist_archive_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Archive Sidebar', 'expert-makeup-stylist' ),
			'section'     => 'expert_makeup_stylist_sidebar_settings',
			'settings'    => 'expert_makeup_stylist_archive_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Index Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_makeup_stylist_index_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_makeup_stylist_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_makeup_stylist_index_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Index Sidebar', 'expert-makeup-stylist' ),
			'section'     => 'expert_makeup_stylist_sidebar_settings',
			'settings'    => 'expert_makeup_stylist_index_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Pages Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_makeup_stylist_paged_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_makeup_stylist_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_makeup_stylist_paged_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Pages Sidebar', 'expert-makeup-stylist' ),
			'section'     => 'expert_makeup_stylist_sidebar_settings',
			'settings'    => 'expert_makeup_stylist_paged_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Search Result Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_makeup_stylist_search_result_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_makeup_stylist_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_makeup_stylist_search_result_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Search Result Sidebar', 'expert-makeup-stylist' ),
			'section'     => 'expert_makeup_stylist_sidebar_settings',
			'settings'    => 'expert_makeup_stylist_search_result_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Single Post Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_makeup_stylist_single_post_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_makeup_stylist_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_makeup_stylist_single_post_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Single Post Sidebar', 'expert-makeup-stylist' ),
			'section'     => 'expert_makeup_stylist_sidebar_settings',
			'settings'    => 'expert_makeup_stylist_single_post_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Sidebar Page Sidebar Date Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_makeup_stylist_single_page_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_makeup_stylist_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_makeup_stylist_single_page_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Page Width Sidebar', 'expert-makeup-stylist' ),
			'section'     => 'expert_makeup_stylist_sidebar_settings',
			'settings'    => 'expert_makeup_stylist_single_page_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	$wp_customize->add_setting( 'expert_makeup_stylist_sidebar_position', array(
        'default'   => 'right',
        'sanitize_callback' => 'expert_makeup_stylist_sanitize_sidebar_position',
    ));

    $wp_customize->add_control( 'expert_makeup_stylist_sidebar_position', array(
        'label'    => __( 'Sidebar Position', 'expert-makeup-stylist' ),
        'section'  => 'expert_makeup_stylist_sidebar_settings',
        'settings' => 'expert_makeup_stylist_sidebar_position',
        'type'     => 'radio',
        'choices'  => array(
            'right' => __( 'Right Sidebar', 'expert-makeup-stylist' ),
            'left'  => __( 'Left Sidebar', 'expert-makeup-stylist' ),
        ),
    ));

	 $wp_customize->add_setting( 'expert_makeup_stylist_upgrade_page_settings_15',
        array(
            'sanitize_callback' => 'sanitize_text_field'
        )
    );
    $wp_customize->add_control( new Expert_Makeup_Stylist_Control_Upgrade(
        $wp_customize, 'expert_makeup_stylist_upgrade_page_settings_15',
            array(
                'priority'      => 200,
                'section'       => 'expert_makeup_stylist_sidebar_settings',
                'settings'      => 'expert_makeup_stylist_upgrade_page_settings_15',
                'label'         => __( 'Expert Makeup Stylist Pro comes with additional features.', 'expert-makeup-stylist' ),
                'choices'       => array( __( '15+ Ready-Made Sections', 'expert-makeup-stylist' ), __( 'One-Click Demo Import', 'expert-makeup-stylist' ), __( 'WooCommerce Integrated', 'expert-makeup-stylist' ), __( 'Drag & Drop Section Reordering', 'expert-makeup-stylist' ),__( 'Advanced Typography Control', 'expert-makeup-stylist' ),__( 'Intuitive Customization Options', 'expert-makeup-stylist' ),__( '24/7 Support', 'expert-makeup-stylist' ), )
            )
        )
    ); 
}

add_action( 'customize_register', 'expert_makeup_stylist_sidebar_setting' );