<?php
/**
 * Hero Section options
 *
 * @package Theme Palace
 * @subpackage Newstation
 * @since Newstation 1.0.0
 */

// Add Hero section
$wp_customize->add_section( 'newstation_hero_banner_section', array(
	'title'             => esc_html__( 'Hero Section','newstation' ),
	'description'       => esc_html__( 'Hero Section options.', 'newstation' ),
	'panel'             => 'newstation_front_page_panel',
	) );

// Hero content enable control and setting
$wp_customize->add_setting( 'newstation_theme_options[hero_banner_section_enable]', array(
	'default'			=> 	$options['hero_banner_section_enable'],
	'sanitize_callback' => 'newstation_sanitize_switch_control',
	) );

$wp_customize->add_control( new Newstation_Switch_Control( $wp_customize, 'newstation_theme_options[hero_banner_section_enable]', array(
	'label'             => esc_html__( 'Hero Section Enable', 'newstation' ),
	'section'           => 'newstation_hero_banner_section',
	'on_off_label' 		=> newstation_switch_options(),
	) ) );

for ( $i = 1; $i <= 3; $i++ ) :

	// hero posts drop down chooser control and setting
$wp_customize->add_setting( 'newstation_theme_options[hero_banner_content_post_' . $i . ']', array(
	'sanitize_callback' => 'newstation_sanitize_page',
	) );

$wp_customize->add_control( new Newstation_Dropdown_Chooser( $wp_customize, 'newstation_theme_options[hero_banner_content_post_' . $i . ']', array(
	'label'             => sprintf( esc_html__( 'Select Post %d', 'newstation' ), $i ),
	'section'           => 'newstation_hero_banner_section',
	'choices'			=> newstation_post_choices(),
	'active_callback'	=> 'newstation_is_hero_banner_section_enable',
	) ) );

endfor;