<?php 
$wp_customize->add_section( 'buconz_starter_hero_slider_section', array(
	'capability'            => 'edit_theme_options',
	'priority'              => 1,
	'title'                 => __( 'Hero Slider', 'buconz-starter' ),
	'description'           => __( 'Hero slider section', 'buconz-starter' ),
	'panel'                 => 'buconz_starter_front_option'
) );

$wp_customize->add_setting( 'buconz_starter_main_area',
  array(
    'default'           => '',
    'sanitize_callback'     => 'buconz_starter_sanitize_checkbox'
  )
);

$wp_customize->add_control( 'buconz_starter_main_area',
  array(
    'label'         => esc_html__( 'Show Hero Slider', 'buconz-starter' ),
    'section'       => 'buconz_starter_hero_slider_section',
    'type'          => 'checkbox',
    'priority'      => 1,
  )
);

for ($i=1;$i<=3;$i++) {
	$wp_customize->add_setting( 'buconz_starter_slider_page_'.$i, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'buconz_starter_sanitize_dropdown_pages'
	) );


	$wp_customize->add_control( 'buconz_starter_slider_page_'.$i, array(
		/* translators: %s: Description */ 
	    'label'                 =>  sprintf( __( 'Select page for slider %s', 'buconz-starter' ), $i ),
	    'section'               => 'buconz_starter_hero_slider_section',
	    'type'                  => 'dropdown-pages',
	    'settings'              => 'buconz_starter_slider_page_'.$i,
	) );
	
	$wp_customize->add_setting( 'buconz_starter_slider_sub_title_'.$i, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'sanitize_text_field'
	) );

	$wp_customize->add_control( 'buconz_starter_slider_sub_title_'.$i, array(
		/* translators: %s: Description */ 
	    'label'                 =>  sprintf( __( 'Slider Sub title %s', 'buconz-starter' ), $i ),
	    'section'               => 'buconz_starter_hero_slider_section',
	    'type'                  => 'text',
	    'settings' => 'buconz_starter_slider_sub_title_'.$i,
	) );
	
	$wp_customize->add_setting( 'buconz_starter_slider_main_title_'.$i, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'sanitize_text_field'
	) );

	$wp_customize->add_control( 'buconz_starter_slider_main_title_'.$i, array(
		/* translators: %s: Description */ 
	    'label'                 =>  sprintf( __( 'Slider main heading %s', 'buconz-starter' ), $i ),
	    'section'               => 'buconz_starter_hero_slider_section',
	    'type'                  => 'text',
	    'description'           => sprintf( esc_html__( 'Type slider title.', 'buconz-starter' )),
	    'settings' => 'buconz_starter_slider_main_title_'.$i,
	) );
	
	$wp_customize->add_setting( 'buconz_starter_slider_button_title_'.$i, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'sanitize_text_field'
	) );

	$wp_customize->add_control( 'buconz_starter_slider_button_title_'.$i, array(
		/* translators: %s: Description */ 
	    'label'                 =>  sprintf( __( 'Slider button text %s', 'buconz-starter' ), $i ),
	    'section'               => 'buconz_starter_hero_slider_section',
	    'type'                  => 'text',
	    'settings' => 'buconz_starter_slider_button_title_'.$i,
	) );
	
	$wp_customize->add_setting( 'buconz_starter_slider_button_url_'.$i, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'esc_url_raw'
	) );
 
	$wp_customize->add_control( 'buconz_starter_slider_button_url_'.$i, array(
		/* translators: %s: Description */ 
	    'label'                 =>  sprintf( __( 'Slider Button URL %s', 'buconz-starter' ), $i ),
	    'section'               => 'buconz_starter_hero_slider_section',
	    'type'                  => 'url',
	    'settings' => 'buconz_starter_slider_button_url_'.$i,
	) );
	
	$wp_customize->add_setting( 'buconz_starter_slider_right_image'.$i, array(
		'width'         => 1200,
		'height'         => 385,
		'sanitize_callback'     => 'buconz_starter_sanitize_image'
	) );
 
	$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'buconz_starter_slider_right_image'.$i, array(
		'label'             => __('Upload achivement image', 'buconz-starter'),
		'section'           => 'buconz_starter_hero_slider_section',
		'settings'          => 'buconz_starter_slider_right_image',
	)));    
	
	
	
	
}