<?php
/**
 * Archive Layout Settings
 *
 * @link https://developer.wordpress.org/themes/advanced-topics/customizer-api/
 *
 * @package Jarvis
 * @subpackage ThemeCustomizerSettings
 * @author Ben Gillbanks <ben@prothemedesign.com>
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
 */

/**
 * Theme Customizer properties
 *
 * @param WP_Customize_Manager $wp_customize WP Customize object. Passed by WordPress.
 * @return void
 */
function jarvis_customizer_archive( WP_Customize_Manager $wp_customize ) {

	/**
	 * Jarvis theme options section.
	 */
	$wp_customize->add_section(
		'jarvis_archive',
		array(
			'title' => esc_html__( 'Homepage & Archive', 'jarvis' ),
			'panel' => 'jarvis_site_layout',
		)
	);

	/**
	 * Setting to change the archive header height.
	 */
	$wp_customize->add_setting(
		'jarvis_archive_header_height',
		array(
			'default' => 1,
			'capability' => 'edit_theme_options',
			'sanitize_callback' => 'jarvis_sanitize_int',
			'transport' => 'postMessage',
		)
	);

	$wp_customize->add_control(
		'jarvis_archive_header_height',
		array(
			'label' => esc_html__( 'Header Height', 'jarvis' ),
			'section' => 'jarvis_archive',
			'type' => 'radio',
			'choices' => array(
				0 => esc_html__( 'Small', 'jarvis' ),
				1 => esc_html__( 'Medium (Default)', 'jarvis' ),
				2 => esc_html__( 'Full Height', 'jarvis' ),
			),
		)
	);

	/**
	 * Setting to change the archive article layout.
	 */
	$wp_customize->add_setting(
		'jarvis_archive_articles',
		array(
			'default' => 0,
			'capability' => 'edit_theme_options',
			'sanitize_callback' => 'jarvis_sanitize_int',
			'transport' => 'postMessage',
		)
	);

	$wp_customize->add_control(
		'jarvis_archive_articles',
		array(
			'label' => esc_html__( 'Archive Post Layout', 'jarvis' ),
			'section' => 'jarvis_archive',
			'type' => 'radio',
			'choices' => array(
				0 => esc_html__( 'Rows, no images (Default)', 'jarvis' ),
				1 => esc_html__( '2 Columns, Featured Image', 'jarvis' ),
				2 => esc_html__( '3 Columns, Featured Image (large screens only)', 'jarvis' ),
				3 => esc_html__( 'Rows, with Featured Image on left', 'jarvis' ),
				4 => esc_html__( 'Rows, with Featured Image on right', 'jarvis' ),
			),
		)
	);

}


