<?php
/**
 * Sidebar settings.
 */

$wp_customize->add_section(
	'news_articles_sidebar_option',
	array(
		'title' => esc_html__( 'Sidebar Options', 'news-articles' ),
		'panel' => 'news_articles_theme_options_panel',
	)
);

// Sidebar Option - Global Sidebar Position.
$wp_customize->add_setting(
	'news_articles_sidebar_position',
	array(
		'sanitize_callback' => 'news_articles_sanitize_select',
		'default'           => 'right-sidebar',
	)
);

$wp_customize->add_control(
	'news_articles_sidebar_position',
	array(
		'label'   => esc_html__( 'Global Sidebar Position', 'news-articles' ),
		'section' => 'news_articles_sidebar_option',
		'type'    => 'select',
		'choices' => array(
			'right-sidebar' => esc_html__( 'Right Sidebar', 'news-articles' ),
			'no-sidebar'    => esc_html__( 'No Sidebar', 'news-articles' ),
		),
	)
);

// Sidebar Option - Post Sidebar Position.
$wp_customize->add_setting(
	'news_articles_post_sidebar_position',
	array(
		'sanitize_callback' => 'news_articles_sanitize_select',
		'default'           => 'right-sidebar',
	)
);

$wp_customize->add_control(
	'news_articles_post_sidebar_position',
	array(
		'label'   => esc_html__( 'Post Sidebar Position', 'news-articles' ),
		'section' => 'news_articles_sidebar_option',
		'type'    => 'select',
		'choices' => array(
			'right-sidebar' => esc_html__( 'Right Sidebar', 'news-articles' ),
			'no-sidebar'    => esc_html__( 'No Sidebar', 'news-articles' ),
		),
	)
);

// Sidebar Option - Page Sidebar Position.
$wp_customize->add_setting(
	'news_articles_page_sidebar_position',
	array(
		'sanitize_callback' => 'news_articles_sanitize_select',
		'default'           => 'right-sidebar',
	)
);

$wp_customize->add_control(
	'news_articles_page_sidebar_position',
	array(
		'label'   => esc_html__( 'Page Sidebar Position', 'news-articles' ),
		'section' => 'news_articles_sidebar_option',
		'type'    => 'select',
		'choices' => array(
			'right-sidebar' => esc_html__( 'Right Sidebar', 'news-articles' ),
			'no-sidebar'    => esc_html__( 'No Sidebar', 'news-articles' ),
		),
	)
);
