<?php
/**
* Layouts Settings.
*
* @package Board Games
*/

$board_games_default = board_games_get_default_theme_options();

// Layout Section.
$wp_customize->add_section( 'board_games_layout_setting',
	array(
	'title'      => esc_html__( 'Sidebar Settings', 'board-games' ),
	'priority'   => 20,
	'capability' => 'edit_theme_options',
	'panel'      => 'board_games_theme_option_panel',
	)
);

$wp_customize->add_setting( 'board_games_global_sidebar_layout',
    array(
    'default'           => $board_games_default['board_games_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'board_games_sanitize_sidebar_option',
    )
);
$wp_customize->add_control( 'board_games_global_sidebar_layout',
    array(
    'label'       => esc_html__( 'Global Sidebar Layout', 'board-games' ),
    'section'     => 'board_games_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__( 'Right Sidebar', 'board-games' ),
        'left-sidebar'  => esc_html__( 'Left Sidebar', 'board-games' ),
        'no-sidebar'    => esc_html__( 'No Sidebar', 'board-games' ),
        ),
    )
);

$wp_customize->add_setting('board_games_page_sidebar_layout', array(
    'default'           => $board_games_default['board_games_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'board_games_sanitize_sidebar_option',
));

$wp_customize->add_control('board_games_page_sidebar_layout', array(
    'label'       => esc_html__('Single Page Sidebar Layout', 'board-games'),
    'section'     => 'board_games_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__('Right Sidebar', 'board-games'),
        'left-sidebar'  => esc_html__('Left Sidebar', 'board-games'),
        'no-sidebar'    => esc_html__('No Sidebar', 'board-games'),
    ),
));

$wp_customize->add_setting('board_games_post_sidebar_layout', array(
    'default'           => $board_games_default['board_games_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'board_games_sanitize_sidebar_option',
));

$wp_customize->add_control('board_games_post_sidebar_layout', array(
    'label'       => esc_html__('Single Post Sidebar Layout', 'board-games'),
    'section'     => 'board_games_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__('Right Sidebar', 'board-games'),
        'left-sidebar'  => esc_html__('Left Sidebar', 'board-games'),
        'no-sidebar'    => esc_html__('No Sidebar', 'board-games'),
    ),
));

$wp_customize->add_setting('board_games_sticky_sidebar',
    array(
        'default'           => true,
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'board_games_sanitize_checkbox',
    )
);
$wp_customize->add_control('board_games_sticky_sidebar',
    array(
        'label' => esc_html__('Enable/Disable Sticky Sidebar', 'board-games'),
        'section' => 'board_games_layout_setting',
        'type' => 'checkbox',
    )
);