<?php
/**
 * Archive Settings
 *
 * Register Home & Archive Settings section, settings and controls for Theme Customizer
 *
 * @package cleanead
 */


/**
 * Adds post settings in the Customizer
 *
 * @param object $wp_customize / Customizer Object
 */
function cleanead_customize_register_archive_options( $wp_customize ) {

	// Add Sections for Post Settings
	$wp_customize->add_section( 'cleanead_section_home_archive', array(
        'title'    => esc_html__( 'Home & Archive Settings', 'cleanead' ),
        'priority' => 30,
		'panel' => 'cleanead_options_panel' 
		)
	);
	
	// Add Settings and Controls for Post length on home & archives
	$wp_customize->add_setting( 'cleanead_theme_options[post_content]', array(
        'default'           => 'excerpt',
        'type'           	=> 'option',
        'transport'         => 'refresh',
        'sanitize_callback' => 'cleanead_sanitize_select'
		)
	);
    $wp_customize->add_control( 'cleanead_theme_options[post_content]', array(
        'label'    => esc_html__( 'Post length on home & archives', 'cleanead' ),
        'section'  => 'cleanead_section_home_archive',
        'settings' => 'cleanead_theme_options[post_content]',
        'type'     => 'radio',
		'priority' => 1,
        'choices'  => array(
            'index' => esc_html__( 'Show full posts', 'cleanead' ),
            'excerpt' => esc_html__( 'Show post excerpts', 'cleanead' )
			)
		)
	);

    // Add Settings and Controls for Pagination
    $wp_customize->add_setting( 'cleanead_theme_options[paging]', array(
        'default'           => 'pageing-default',
        'type'              => 'option',
        'transport'         => 'refresh',
        'sanitize_callback' => 'cleanead_sanitize_select'
        )
    );
    $wp_customize->add_control( 'cleanead_theme_options[paging]', array(
        'label'    => esc_html__( 'Pagination Type', 'cleanead' ),
        'section'  => 'cleanead_section_home_archive',
        'settings' => 'cleanead_theme_options[paging]',
        'type'     => 'radio',
        'priority' => 8,
        'choices'  => array(
            'pageing-default' => esc_html__( 'Default (Older Posts/Newer Posts)', 'cleanead' ),
            'pageing-numberal' => esc_html__( 'Numberal (1 2 3 ..)', 'cleanead' )
            )
        )
    );
	
	
}
add_action( 'customize_register', 'cleanead_customize_register_archive_options' );