<?php
/**
 * Single Settings
 *
 * Register Single 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_single_options( $wp_customize ) {
		// Add Section for Theme Options
		$wp_customize->add_section( 'cleanead_section_single', array(
	        'title'    => esc_html__( 'Single Post Settings', 'cleanead' ),
	        'priority' => 40,
			'panel' => 'cleanead_options_panel' 
			)
		);

		// Add Settings and Controls for Post length on home & archives
		$wp_customize->add_setting( 'cleanead_theme_options[related_posts]', array(
	        'default'           => 'cat',
	        'type'           	=> 'option',
	        'transport'         => 'refresh',
	        'sanitize_callback' => 'cleanead_sanitize_select'
			)
		);
	    $wp_customize->add_control( 'cleanead_theme_options[related_posts]', array(
	        'label'    => esc_html__( 'Related Posts Taxonomy', 'cleanead' ),
	        'section'  => 'cleanead_section_single',
	        'settings' => 'cleanead_theme_options[related_posts]',
	        'type'     => 'radio',
			'priority' => 2,
	        'choices'  => array(
	            'cat' => esc_html__( 'Categories', 'cleanead' ),
	            'tag' => esc_html__( 'Tags', 'cleanead' )
				)
			)
		);

	}
add_action( 'customize_register', 'cleanead_customize_register_single_options' );