<?php
/**
	 * Slider section
	 */
	// Slider section
	$wp_customize->add_section(
		'nuevo_blog_slider',
		array(
			'title' => esc_html__( 'Banner Slider', 'nuevo-blog' ),
			'panel' => 'nuevo_blog_home_panel',
		)
	);

	// Slider Section enable setting
	$wp_customize->add_setting(
		'nuevo_blog_featured_slider_section_enable',
		array(
			'sanitize_callback' => 'nuevo_blog_sanitize_checkbox',
			'default' => true,
		)
	);

	$wp_customize->add_control(
		'nuevo_blog_featured_slider_section_enable',
		array(
			'section'		=> 'nuevo_blog_slider',
			'label'			=> esc_html__( 'Enable Featured Slider Section.', 'nuevo-blog' ),
			'type'			=> 'checkbox',
		)
	);

	// Slider Dot enable setting
	$wp_customize->add_setting(
		'nuevo_blog_featured_slider_dot_enable',
		array(
			'sanitize_callback' => 'nuevo_blog_sanitize_checkbox',
			'default' => true,
		)
	);

	$wp_customize->add_control(
		'nuevo_blog_featured_slider_dot_enable',
		array(
			'section'		=> 'nuevo_blog_slider',
			'label'			=> esc_html__( 'Enable Featured Slider Dot.', 'nuevo-blog' ),
			'type'			=> 'checkbox',
			'active_callback' => 'nuevo_blog_is_featured_slider_enable',
		)
	);
	// Slider Fade Effect enable setting
	$wp_customize->add_setting(
		'nuevo_blog_featured_slider_fade_enable',
		array(
			'sanitize_callback' => 'nuevo_blog_sanitize_checkbox',
			'default' => false,
		)
	);

	$wp_customize->add_control(
		'nuevo_blog_featured_slider_fade_enable',
		array(
			'section'		=> 'nuevo_blog_slider',
			'label'			=> esc_html__( 'Enable Slider Fade Effect.', 'nuevo-blog' ),
			'type'			=> 'checkbox',
			'active_callback' => 'nuevo_blog_is_featured_slider_enable',
		)
	);
	// Slider Infinite Enable setting
	$wp_customize->add_setting(
		'nuevo_blog_featured_slider_arrow_enable',
		array(
			'sanitize_callback' => 'nuevo_blog_sanitize_checkbox',
			'default' => true,
		)
	);

	$wp_customize->add_control(
		'nuevo_blog_featured_slider_arrow_enable',
		array(
			'section'		=> 'nuevo_blog_slider',
			'label'			=> esc_html__( 'Enable Featured Slider Arrow.', 'nuevo-blog' ),
			'type'			=> 'checkbox',
			'active_callback' => 'nuevo_blog_is_featured_slider_enable',
		)
	);
	// Slider Autoplay enable setting
	$wp_customize->add_setting(
		'nuevo_blog_featured_slider_autoplay_enable',
		array(
			'sanitize_callback' => 'nuevo_blog_sanitize_checkbox',
			'default' => true,
		)
	);

	$wp_customize->add_control(
		'nuevo_blog_featured_slider_autoplay_enable',
		array(
			'section'		=> 'nuevo_blog_slider',
			'label'			=> esc_html__( 'Enable Featured Slider Autoplay.', 'nuevo-blog' ),
			'type'			=> 'checkbox',
			'active_callback' => 'nuevo_blog_is_featured_slider_enable',
		)
	);

	// Slider Infinite Enable setting
	$wp_customize->add_setting(
		'nuevo_blog_featured_slider_infinite_enable',
		array(
			'sanitize_callback' => 'nuevo_blog_sanitize_checkbox',
			'default' => true,
		)
	);

	$wp_customize->add_control(
		'nuevo_blog_featured_slider_infinite_enable',
		array(
			'section'		=> 'nuevo_blog_slider',
			'label'			=> esc_html__( 'Enable Featured Slider Infinite Slide.', 'nuevo-blog' ),
			'type'			=> 'checkbox',
			'active_callback' => 'nuevo_blog_is_featured_slider_enable',
		)
	);


	// Slider category setting
	$wp_customize->add_setting(
		'nuevo_blog_slider_cat',
		array(
			'sanitize_callback' => 'nuevo_blog_sanitize_select',
		)
	);

	$wp_customize->add_control(
		'nuevo_blog_slider_cat',
		array(
			'section'		=> 'nuevo_blog_slider',
			'label'			=> esc_html__( 'Category:', 'nuevo-blog' ),
			'active_callback' => 'nuevo_blog_is_featured_slider_enable',
			'type'			=> 'select',
			'choices'		=> nuevo_blog_get_post_cat_choices(),
		)
	);
	$slider_num = get_theme_mod( 'nuevo_blog_slider_num', 3 );
	for ( $i=1; $i <= 4; $i++ ) { 

		// Slider custom name setting
		$wp_customize->add_setting(
			'nuevo_blog_slider_custom_btn_' . $i,
			array(
				'sanitize_callback' => 'sanitize_text_field',
				'default' => $default['nuevo_blog_slider_custom_btn'],
			)
		);

		$wp_customize->add_control(
			'nuevo_blog_slider_custom_btn_' . $i,
			array(
				'section'		=> 'nuevo_blog_slider',
				'label'			=> esc_html__( 'Button text ', 'nuevo-blog' ) . $i,
				'active_callback' => 'nuevo_blog_is_featured_slider_enable'
			)
		);
	}
?>