<?php


/*********************
post-settings
*******************/


// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

$wp_customize->add_panel( 'digital_sidebars_panelnew', array(
    'priority' => 170,
    'capability' => 'edit_theme_options',			
    'description' => __( 'Control theme default settings', 'digital' ),
    'priority'    => apply_filters( 'digital_sidebars_panelnew_priority', 170 ),
    'title' => __( 'Sidebar Settings', 'digital' )
) );

        $wp_customize->add_section('digital_sidebars_section',
        array(
            'title' => __( 'Sidebar Layout', 'digital' ),
            'description' => __( 'Sidebar Panel', 'digital' ),
            'capability'  => 'edit_theme_options',		
            'panel'			=> 'digital_sidebars_panelnew',
            'priority'    => apply_filters( 'digital_sidebars_section_priority', 10 ),
        ));

      


	// Add customizer settings and controls using the digital_Image_Radio_Control class
    $wp_customize->add_setting(
        'digital_sidebar_position',
        array(
            'default'           => 'right',
            'type'              => 'theme_mod',
            'sanitize_callback' => 'digital_customize_sanitize_select',
            'capability'        => 'edit_theme_options',
        )
    );

    $wp_customize->add_control(
        new digital_Image_Radio_Control(
            $wp_customize,
            'digital_sidebar_position',
            array(
                'label'       => __( 'Sidebar Positioning', 'digital' ),
                'description' => __( 'Set sidebar\'s default position. Can either be: right, left, both or none. Note: this can be overridden on individual pages.', 'digital' ),
                'section'     => 'digital_sidebars_section',
                'choices'     => array(
                    'right'  => get_template_directory_uri() . '/images/right.png',
                    'left' => get_template_directory_uri() . '/images/left.png',
                    'both' => get_template_directory_uri() . '/images/bothsides.png',
                    'none' => get_template_directory_uri() . '/images/fullnone.png',
                ),
                'priority'    => apply_filters( 'digital_sidebar_position_priority', 10 ),
            )
        ));

	//Posts
    $wp_customize->add_setting('digital_sidebar_posts',	
    array(
        'default'			=> true,
        'type'				=> 'theme_mod',
        'capability'		=> 'edit_theme_options',
        'sanitize_callback'	=> 'digital_customize_sanitize_checkbox'
    ));
    $wp_customize->add_control('digital_sidebar_posts',
        array (                             
            'type'    => 'checkbox',
            'label' => __('Posts','digital'),
            'description'        => __( 'Control Sidebar in Posts', 'digital' ),
            'settings'   => 'digital_sidebar_posts',
            'section' => 'digital_sidebars_section',
            'priority'    => apply_filters( 'digital_sidebar_posts_priority', 15 ),
        ));	
	//Pages
    $wp_customize->add_setting('digital_sidebar_pages',	
    array(
        'default'			=> true,
        'type'				=> 'theme_mod',
        'capability'		=> 'edit_theme_options',
        'sanitize_callback'	=> 'digital_customize_sanitize_checkbox'
    ));
    $wp_customize->add_control('digital_sidebar_pages',
        array (                             
            'type'    => 'checkbox',
            'label' => __('Pages','digital'),
            'description'        => __( 'Control Sidebar in Pages', 'digital' ),
            'settings'   => 'digital_sidebar_pages',
            'section' => 'digital_sidebars_section',
            'priority'    => apply_filters( 'digital_sidebar_pages_priority', 20 ),
        ));	
	//Index
    $wp_customize->add_setting('digital_sidebar_index',	
    array(
        'default'			=> false,
        'type'				=> 'theme_mod',
        'capability'		=> 'edit_theme_options',
        'sanitize_callback'	=> 'digital_customize_sanitize_checkbox'
    ));
    $wp_customize->add_control('digital_sidebar_index',
        array (                             
            'type'    => 'checkbox',
            'label' => __('Index','digital'),
            'description'        => __( 'Control Sidebar in Index', 'digital' ),
            'settings'   => 'digital_sidebar_index',
            'section' => 'digital_sidebars_section',
            'priority'    => apply_filters( 'digital_sidebar_index_priority', 20 ),
        ));	


        $wp_customize->add_setting(
            'digital_breadcrumbs_headingset',
            array(
                'sanitize_callback' => 'wp_kses',
            ));
    
    
            $wp_customize->add_control(
                new digital_Customizer_Heading_Control(
                    $wp_customize,
                    'digital_breadcrumbs_headingset',
                    array(
                        'label'    => esc_html__( 'Sidebar Settings', 'digital' ),
                        'section'  => 'digital_sidebars_section',
                        'priority' => 40,
                    )));

        $wp_customize->add_setting('digital_sticky_sidebarblog',	
        array(
            'default'			=> 'disable',
            'type'				=> 'theme_mod',
            'capability'		=> 'edit_theme_options',
            'sanitize_callback'	=> 'digital_customize_sanitize_select'
        ));
        $wp_customize->add_control('digital_sticky_sidebarblog',
            array (                             
            'type' => 'radio',
            'label' => __('Sticky Sidebars','digital'),
            'settings'   => 'digital_sticky_sidebarblog',
            'section' => 'digital_sidebars_section',
            'choices' => array(
                'enable' => __('Enable','digital'),
                'disable' => __('Disable','digital'),
                ),
            ));

      