<?php
/**
* Layouts Settings.
*
* @package Green Nursery
*/

$green_nursery_default = green_nursery_get_default_theme_options();

// Layout Section.
$wp_customize->add_section( 'green_nursery_layout_setting',
	array(
	'title'      => esc_html__( 'Sidebar Settings', 'green-nursery' ),
	'priority'   => 20,
	'capability' => 'edit_theme_options',
	'panel'      => 'green_nursery_theme_option_panel',
	)
);

$wp_customize->add_setting( 'green_nursery_global_sidebar_layout',
    array(
    'default'           => $green_nursery_default['green_nursery_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'green_nursery_sanitize_sidebar_option',
    )
);
$wp_customize->add_control( 'green_nursery_global_sidebar_layout',
    array(
    'label'       => esc_html__( 'Global Sidebar Layout', 'green-nursery' ),
    'section'     => 'green_nursery_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__( 'Right Sidebar', 'green-nursery' ),
        'left-sidebar'  => esc_html__( 'Left Sidebar', 'green-nursery' ),
        'no-sidebar'    => esc_html__( 'No Sidebar', 'green-nursery' ),
        ),
    )
);

$wp_customize->add_setting('green_nursery_page_sidebar_layout', array(
    'default'           => $green_nursery_default['green_nursery_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'green_nursery_sanitize_sidebar_option',
));

$wp_customize->add_control('green_nursery_page_sidebar_layout', array(
    'label'       => esc_html__('Single Page Sidebar Layout', 'green-nursery'),
    'section'     => 'green_nursery_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__('Right Sidebar', 'green-nursery'),
        'left-sidebar'  => esc_html__('Left Sidebar', 'green-nursery'),
        'no-sidebar'    => esc_html__('No Sidebar', 'green-nursery'),
    ),
));

$wp_customize->add_setting('green_nursery_post_sidebar_layout', array(
    'default'           => $green_nursery_default['green_nursery_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'green_nursery_sanitize_sidebar_option',
));

$wp_customize->add_control('green_nursery_post_sidebar_layout', array(
    'label'       => esc_html__('Single Post Sidebar Layout', 'green-nursery'),
    'section'     => 'green_nursery_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__('Right Sidebar', 'green-nursery'),
        'left-sidebar'  => esc_html__('Left Sidebar', 'green-nursery'),
        'no-sidebar'    => esc_html__('No Sidebar', 'green-nursery'),
    ),
));

$wp_customize->add_setting('green_nursery_sticky_sidebar',
    array(
        'default'           => true,
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'green_nursery_sanitize_checkbox',
    )
);
$wp_customize->add_control('green_nursery_sticky_sidebar',
    array(
        'label' => esc_html__('Enable/Disable Sticky Sidebar', 'green-nursery'),
        'section' => 'green_nursery_layout_setting',
        'type' => 'checkbox',
    )
);