<?php
/**
 * Customize  Object 
 */	

$wp_customize->add_panel('vastnews_front_options',array(
    'title'=>'Front Page Options',
    'priority'=> 140,
));


//slider Section
$wp_customize->add_section( 'vastnews_slider_section', array (
	'title'     => esc_html__( 'Slider Section', 'vastnews' ),
	'panel'     => 'vastnews_front_options',
	'priority'  => 10
) );


// slider setting			  
$wp_customize->add_setting ( 'vastnews_slider_display', array (
	'default'           => true,
	'sanitize_callback' => 'vastnews_sanitize_checkbox',
) );


$wp_customize->add_control ( 'vastnews_slider_display', array (
	'label'           => esc_html__( 'Display slider', 'vastnews' ),
	'section'         => 'vastnews_slider_section',
	'priority'        => 10,
	'type'            => 'checkbox',
	
) );


// number of posts setting
$wp_customize->add_setting(
	'vastnews_post_number',array(
		'default'           => 4,
		'sanitize_callback' => 'vastnews_sanitize_number_range',
	)
);

    
$wp_customize->add_control(
	'vastnews_post_number',array(
		'label'       => esc_html__( 'number of posts(min = 1,max =5)', 'vastnews' ),
		'section'     => 'vastnews_slider_section',
		'settings'    => 'vastnews_post_number',
		'type'        => 'number',
		'input_attrs' => array(
			'min'  => 1,
			'max'  => 5,
			'step' => 1,
		),
	)
);


// category of posts setting
$wp_customize->add_setting(
	'vastnews_post_category',array(
		'sanitize_callback' => 'vastnews_sanitize_select',
	)
);


$wp_customize->add_control(
	'vastnews_post_category',array(
		'label'           => esc_html__( 'Select Category', 'vastnews' ),
		'section'         => 'vastnews_slider_section',
		'settings'        => 'vastnews_post_category',
		'type'            => 'select',
		'choices'         => vastnews_get_post_cat_choices(),
	)
);