<?php
function expert_dental_specialist_sidebar_setting( $wp_customize ) {
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
	$wp_customize->add_panel(
		'expert_dental_specialist_sidebar', array(
			'priority' => 31,
			'title' => esc_html__( 'Sidebar Options', 'expert-dental-specialist' ),
		)
	);

	/*=========================================
	Sidebar Option  Section
	=========================================*/
	$wp_customize->add_section(
		'expert_dental_specialist_sidebar_settings', array(
			'title' => esc_html__( 'Sidebar Options', 'expert-dental-specialist' ),
			'priority' => 1,
			'panel' => 'expert_dental_specialist_general',
		)
	);
	

	// Archive Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_dental_specialist_archive_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_dental_specialist_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_dental_specialist_archive_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Archive Sidebar', 'expert-dental-specialist' ),
			'section'     => 'expert_dental_specialist_sidebar_settings',
			'settings'    => 'expert_dental_specialist_archive_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Index Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_dental_specialist_index_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_dental_specialist_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_dental_specialist_index_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Index Sidebar', 'expert-dental-specialist' ),
			'section'     => 'expert_dental_specialist_sidebar_settings',
			'settings'    => 'expert_dental_specialist_index_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Pages Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_dental_specialist_paged_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_dental_specialist_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_dental_specialist_paged_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Pages Sidebar', 'expert-dental-specialist' ),
			'section'     => 'expert_dental_specialist_sidebar_settings',
			'settings'    => 'expert_dental_specialist_paged_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Search Result Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_dental_specialist_search_result_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_dental_specialist_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_dental_specialist_search_result_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Search Result Sidebar', 'expert-dental-specialist' ),
			'section'     => 'expert_dental_specialist_sidebar_settings',
			'settings'    => 'expert_dental_specialist_search_result_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Single Post Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_dental_specialist_single_post_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_dental_specialist_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_dental_specialist_single_post_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Single Post Sidebar', 'expert-dental-specialist' ),
			'section'     => 'expert_dental_specialist_sidebar_settings',
			'settings'    => 'expert_dental_specialist_single_post_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Sidebar Page Sidebar Date Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_dental_specialist_single_page_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_dental_specialist_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_dental_specialist_single_page_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Page Width Sidebar', 'expert-dental-specialist' ),
			'section'     => 'expert_dental_specialist_sidebar_settings',
			'settings'    => 'expert_dental_specialist_single_page_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	$wp_customize->add_setting( 'expert_dental_specialist_sidebar_position', array(
        'default'   => 'right',
        'sanitize_callback' => 'expert_dental_specialist_sanitize_sidebar_position',
    ));

    $wp_customize->add_control( 'expert_dental_specialist_sidebar_position', array(
        'label'    => __( 'Sidebar Position', 'expert-dental-specialist' ),
        'section'  => 'expert_dental_specialist_sidebar_settings',
        'settings' => 'expert_dental_specialist_sidebar_position',
        'type'     => 'radio',
        'choices'  => array(
            'right' => __( 'Right Sidebar', 'expert-dental-specialist' ),
            'left'  => __( 'Left Sidebar', 'expert-dental-specialist' ),
        ),
    ));

	$wp_customize->add_setting( 'expert_dental_specialist_upgrade_page_settings_15',
	array(
		'sanitize_callback' => 'sanitize_text_field'
	)
	);
	$wp_customize->add_control( new Expert_Dental_Specialist_Control_Upgrade(
		$wp_customize, 'expert_dental_specialist_upgrade_page_settings_15',
			array(
				'priority'      => 200,
				'section'       => 'expert_dental_specialist_sidebar_settings',
				'settings'      => 'expert_dental_specialist_upgrade_page_settings_15',
				'label'         => __( 'Expert Dental Specialist Pro comes with additional features.', 'expert-dental-specialist' ),
				'choices'       => array( __( '15+ Ready-Made Sections', 'expert-dental-specialist' ), __( 'One-Click Demo Import', 'expert-dental-specialist' ), __( 'WooCommerce Integrated', 'expert-dental-specialist' ), __( 'Drag & Drop Section Reordering', 'expert-dental-specialist' ),__( 'Advanced Typography Control', 'expert-dental-specialist' ),__( 'Intuitive Customization Options', 'expert-dental-specialist' ),__( '24/7 Support', 'expert-dental-specialist' ), )
			)
		)
	); 

}

add_action( 'customize_register', 'expert_dental_specialist_sidebar_setting' );