<?php
/**
 * Moral Theme Customizer
 *
 * @package Moral
 *
 * have_missed section
 */

$wp_customize->add_section(
	'moral_magazine_have_missed',
	array(
		'title' => esc_html__( 'Have Missed', 'moral-magazine' ),
		'panel' => 'moral_magazine_home_panel',
	)
);

// have_missed enable settings
$wp_customize->add_setting(
	'moral_magazine_have_missed',
	array(
		'sanitize_callback' => 'moral_magazine_sanitize_select',
		'default' => 'disable'
	)
);

$wp_customize->add_control(
	'moral_magazine_have_missed',
	array(
		'section'		=> 'moral_magazine_have_missed',
		'label'			=> esc_html__( 'Content type:', 'moral-magazine' ),
		'description'			=> esc_html__( 'Choose where you want to render the content from.', 'moral-magazine' ),
		'type'			=> 'select',
		'choices'		=> array( 
				'disable' => esc_html__( '--Disable--', 'moral-magazine' ),
				'post' => esc_html__( 'Post', 'moral-magazine' ),
		 	)
	)
);


$wp_customize->add_setting(
	'moral_magazine_have_missed_title',
	array(
		'sanitize_callback' => 'sanitize_text_field',
		'default' => esc_html__( 'You Have Missed', 'moral-magazine' ),
	)
);

$wp_customize->add_control(
	'moral_magazine_have_missed_title',
	array(
		'section'		=> 'moral_magazine_have_missed',
		'label'			=> esc_html__( 'Title:', 'moral-magazine' ),
	)
);


$have_missed_num = 4;
for ($i=1; $i <= $have_missed_num ; $i++) { 
	// have_missed post setting
	$wp_customize->add_setting(
		'moral_magazine_have_missed_post_'.$i,
		array(
			'sanitize_callback' => 'moral_magazine_sanitize_dropdown_pages',
		)
	);

	$wp_customize->add_control(
		'moral_magazine_have_missed_post_'.$i,
		array(
			'section'		=> 'moral_magazine_have_missed',
			'label'			=> esc_html__( 'Post ', 'moral-magazine' ).$i,
			'type'			=> 'select',
			'choices'		=> moral_magazine_get_post_choices(),
		)
	);

}
