<?php
function expert_ngo_volunteer_sidebar_setting( $wp_customize ) {
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
	$wp_customize->add_panel(
		'expert_ngo_volunteer_sidebar', array(
			'priority' => 31,
			'title' => esc_html__( 'Sidebar Options', 'expert-ngo-volunteer' ),
		)
	);

	/*=========================================
	Sidebar Option  Section
	=========================================*/
	$wp_customize->add_section(
		'expert_ngo_volunteer_sidebar_settings', array(
			'title' => esc_html__( 'Sidebar Options', 'expert-ngo-volunteer' ),
			'priority' => 1,
			'panel' => 'expert_ngo_volunteer_general',
		)
	);
	

	// Archive Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_ngo_volunteer_archive_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_ngo_volunteer_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_ngo_volunteer_archive_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Archive Sidebar', 'expert-ngo-volunteer' ),
			'section'     => 'expert_ngo_volunteer_sidebar_settings',
			'settings'    => 'expert_ngo_volunteer_archive_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Index Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_ngo_volunteer_index_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_ngo_volunteer_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_ngo_volunteer_index_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Index Sidebar', 'expert-ngo-volunteer' ),
			'section'     => 'expert_ngo_volunteer_sidebar_settings',
			'settings'    => 'expert_ngo_volunteer_index_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Pages Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_ngo_volunteer_paged_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_ngo_volunteer_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_ngo_volunteer_paged_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Pages Sidebar', 'expert-ngo-volunteer' ),
			'section'     => 'expert_ngo_volunteer_sidebar_settings',
			'settings'    => 'expert_ngo_volunteer_paged_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Search Result Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_ngo_volunteer_search_result_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_ngo_volunteer_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_ngo_volunteer_search_result_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Search Result Sidebar', 'expert-ngo-volunteer' ),
			'section'     => 'expert_ngo_volunteer_sidebar_settings',
			'settings'    => 'expert_ngo_volunteer_search_result_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Single Post Sidebar Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_ngo_volunteer_single_post_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_ngo_volunteer_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_ngo_volunteer_single_post_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Single Post Sidebar', 'expert-ngo-volunteer' ),
			'section'     => 'expert_ngo_volunteer_sidebar_settings',
			'settings'    => 'expert_ngo_volunteer_single_post_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	// Sidebar Page Sidebar Date Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_ngo_volunteer_single_page_sidebar_setting' , 
			array(
			'default' => '1',
			'sanitize_callback' => 'expert_ngo_volunteer_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_ngo_volunteer_single_page_sidebar_setting', 
		array(
			'label'	      => esc_html__( 'Hide / Show Page Width Sidebar', 'expert-ngo-volunteer' ),
			'section'     => 'expert_ngo_volunteer_sidebar_settings',
			'settings'    => 'expert_ngo_volunteer_single_page_sidebar_setting',
			'type'        => 'checkbox'
		) 
	);

	$wp_customize->add_setting( 'expert_ngo_volunteer_sidebar_position', array(
        'default'   => 'right',
        'sanitize_callback' => 'expert_ngo_volunteer_sanitize_sidebar_position',
    ));

    $wp_customize->add_control( 'expert_ngo_volunteer_sidebar_position', array(
        'label'    => __( 'Sidebar Position', 'expert-ngo-volunteer' ),
        'section'  => 'expert_ngo_volunteer_sidebar_settings',
        'settings' => 'expert_ngo_volunteer_sidebar_position',
        'type'     => 'radio',
        'choices'  => array(
            'right' => __( 'Right Sidebar', 'expert-ngo-volunteer' ),
            'left'  => __( 'Left Sidebar', 'expert-ngo-volunteer' ),
        ),
    ));

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

add_action( 'customize_register', 'expert_ngo_volunteer_sidebar_setting' );