<?php
/**
 * Global Layout
 */
// Global Layout
$wp_customize->add_section(
	'ostrich_magazine_global_layout',
	array(
		'title' => esc_html__( 'Global Layout', 'ostrich-magazine' ),
		'panel' => 'ostrich_magazine_general_panel',
	)
);

// Global site layout setting
$wp_customize->add_setting(
	'ostrich_magazine_site_layout',
	array(
		'sanitize_callback' => 'ostrich_magazine_sanitize_select',
		'default' => 'wide',
		'transport'	=> 'postMessage',
	)
);

$wp_customize->add_control(
	'ostrich_magazine_site_layout',
	array(
		'section'		=> 'ostrich_magazine_global_layout',
		'label'			=> esc_html__( 'Site layout', 'ostrich-magazine' ),
		'type'			=> 'radio',
		'choices'		=> array( 
			'boxed' => esc_html__( 'Boxed', 'ostrich-magazine' ), 
			'wide' => esc_html__( 'Wide', 'ostrich-magazine' ), 
			'frame' => esc_html__( 'Frame', 'ostrich-magazine' ), 
		),
	)
);

// Global archive layout setting
$wp_customize->add_setting(
	'ostrich_magazine_archive_sidebar',
	array(
		'sanitize_callback' => 'ostrich_magazine_sanitize_select',
		'default' => 'right',
	)
);

$wp_customize->add_control(
	'ostrich_magazine_archive_sidebar',
	array(
		'section'		=> 'ostrich_magazine_global_layout',
		'label'			=> esc_html__( 'Archive Sidebar', 'ostrich-magazine' ),
		'description'			=> esc_html__( 'This option works on all archive pages like: 404, search, date, category, "Your latest posts" and so on.', 'ostrich-magazine' ),
		'type'			=> 'radio',
		'choices'		=> array(  
			'right' => esc_html__( 'Right', 'ostrich-magazine' ), 
			'no' => esc_html__( 'No Sidebar', 'ostrich-magazine' ), 
		),
	)
);

// Global page layout setting
$wp_customize->add_setting(
	'ostrich_magazine_global_page_layout',
	array(
		'sanitize_callback' => 'ostrich_magazine_sanitize_select',
		'default' => 'right',
	)
);

$wp_customize->add_control(
	'ostrich_magazine_global_page_layout',
	array(
		'section'		=> 'ostrich_magazine_global_layout',
		'label'			=> esc_html__( 'Global page sidebar', 'ostrich-magazine' ),
		'description'			=> esc_html__( 'This option works only on single pages including "Posts page". This setting can be overridden for single page from the metabox too.', 'ostrich-magazine' ),
		'type'			=> 'radio',
		'choices'		=> array(  
			'right' => esc_html__( 'Right', 'ostrich-magazine' ), 
			'no' => esc_html__( 'No Sidebar', 'ostrich-magazine' ), 
		),
	)
);

// Global post layout setting
$wp_customize->add_setting(
	'ostrich_magazine_global_post_layout',
	array(
		'sanitize_callback' => 'ostrich_magazine_sanitize_select',
		'default' => 'right',
	)
);

$wp_customize->add_control(
	'ostrich_magazine_global_post_layout',
	array(
		'section'		=> 'ostrich_magazine_global_layout',
		'label'			=> esc_html__( 'Global post sidebar', 'ostrich-magazine' ),
		'description'			=> esc_html__( 'This option works only on single posts. This setting can be overridden for single post from the metabox too.', 'ostrich-magazine' ),
		'type'			=> 'radio',
		'choices'		=> array(  
			'right' => esc_html__( 'Right', 'ostrich-magazine' ), 
			'no' => esc_html__( 'No Sidebar', 'ostrich-magazine' ), 
		),
	)
);