<?php 
$wp_customize->add_section( 'roland_hero_slider_section', array(
	'capability'            => 'edit_theme_options',
	'priority'              => 1,
	'title'                 => __( 'Hero Slider', 'roland' ),
	'description'           => __( 'Hero slider section', 'roland' ),
	'panel'                 => 'roland_front_option'
) );


// Hero Section Enable / Disable
$wp_customize->add_setting( 'roland_hero_slider',
  array(
    'default'           => '',
    'sanitize_callback'     => 'roland_sanitize_checkbox'
  )
);

$wp_customize->add_control( 'roland_hero_slider',
  array(
    'label'         => esc_html__( 'Show Hero Slider', 'roland' ),
    'section'       => 'roland_hero_slider_section',
    'type'          => 'checkbox',
    'priority'      => 1,
  )
);

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


	$wp_customize->add_control( 'roland_slider_page_'.$i, array(
		/* translators: %s: Description */ 
	    'label'                 =>  sprintf( __( 'Select page for slider %s', 'roland' ), $i ),
	    'section'               => 'roland_hero_slider_section',
	    'type'                  => 'dropdown-pages',
	    'settings'              => 'roland_slider_page_'.$i,
	) );
	
	$wp_customize->add_setting( 'roland_slider_main_title_'.$i, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'wp_filter_nohtml_kses'
	) );

	$wp_customize->add_control( 'roland_slider_main_title_'.$i, array(
		/* translators: %s: Description */ 
	    'label'                 =>  sprintf( __( 'Slider main heading %s', 'roland' ), $i ),
	    'section'               => 'roland_hero_slider_section',
	    'type'                  => 'textarea',
	    'description'           => sprintf( esc_html__( 'Type slider heading title, content you can add/edit from selected page content.', 'roland' )),
	    'settings' => 'roland_slider_main_title_'.$i,
	) );
	
	
	/* Department Icon 1 */
	$wp_customize->add_setting( 'roland_slider_department_icon_'.$i, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'wp_filter_nohtml_kses'
	) );

	$wp_customize->add_control( 'roland_slider_department_icon_'.$i, array(
		/* translators: %s: Description */ 
	    'label'                 =>  sprintf( __( 'Department Icon 1', 'roland' ), $i ),
	    'section'               => 'roland_hero_slider_section',
	    'type'                  => 'text',
	    'description'           => sprintf( __( 'Type Icofont Icon: Eg: %1$s. %2$s See more here %3$s', 'roland' ), $i,'<a href="'.esc_url('https://icofont.com/icons').'">','</a>'),
	    'settings' => 'roland_slider_department_icon_'.$i,
	) );
	
	/* Department URL 1 */
	$wp_customize->add_setting( 'roland_slider_department_url_'.$i, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'esc_url_raw'
	) );

	$wp_customize->add_control( 'roland_slider_department_url_'.$i, array(
		/* translators: %s: Description */ 
	    'label'                 =>  sprintf( __( 'Department URL 1', 'roland' ), $i ),
	    'section'               => 'roland_hero_slider_section',
	    'type'                  => 'url',
	    'description'           => sprintf( esc_html__( 'Type Page URL.', 'roland' )),
	    'settings' => 'roland_slider_department_url_'.$i,
	) );
	
	/* Department Icon 2 */
	$wp_customize->add_setting( 'roland_slider_department_icon_two_'.$i, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'wp_filter_nohtml_kses'
	) );

	$wp_customize->add_control( 'roland_slider_department_icon_two_'.$i, array(
		/* translators: %s: Description */ 
	    'label'                 =>  sprintf( __( 'Department Icon 2', 'roland' ), $i ),
	    'section'               => 'roland_hero_slider_section',
	    'type'                  => 'text',
	    'description'           => sprintf( __( 'Type Icofont Icon: Eg: %1$s. %2$s See more here %3$s', 'roland' ), $i,'<a href="'.esc_url('https://icofont.com/icons').'">','</a>'),
	    'settings' => 'roland_slider_department_icon_two_'.$i,
	) );
	
	/* Department URL 2 */
	$wp_customize->add_setting( 'roland_slider_department_url_two_'.$i, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'esc_url_raw'
	) );

	$wp_customize->add_control( 'roland_slider_department_url_two_'.$i, array(
		/* translators: %s: Description */ 
	    'label'                 =>  sprintf( __( 'Department URL 2', 'roland' ), $i ),
	    'section'               => 'roland_hero_slider_section',
	    'type'                  => 'url',
	    'description'           => sprintf( esc_html__( 'Type Page URL.', 'roland' )),
	    'settings' => 'roland_slider_department_url_two_'.$i,
	) );
	
	/* Department Icon 3 */
	$wp_customize->add_setting( 'roland_slider_department_icon_three_'.$i, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'wp_filter_nohtml_kses'
	) );

	$wp_customize->add_control( 'roland_slider_department_icon_three_'.$i, array(
		/* translators: %s: Description */ 
	    'label'                 =>  sprintf( __( 'Department Icon 3', 'roland' ), $i ),
	    'section'               => 'roland_hero_slider_section',
	    'type'                  => 'text',
	    'description'           => sprintf( __( 'Type Icofont Icon: Eg: %1$s. %2$s See more here %3$s', 'roland' ), $i,'<a href="'.esc_url('https://icofont.com/icons').'">','</a>'),
	    'settings' => 'roland_slider_department_icon_three_'.$i,
	) );
	
	/* Department URL 3 */
	$wp_customize->add_setting( 'roland_slider_department_url_three_'.$i, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'esc_url_raw'
	) );

	$wp_customize->add_control( 'roland_slider_department_url_three_'.$i, array(
		/* translators: %s: Description */ 
	    'label'                 =>  sprintf( __( 'Department URL 3', 'roland' ), $i ),
	    'section'               => 'roland_hero_slider_section',
	    'type'                  => 'url',
	    'description'           => sprintf( esc_html__( 'Type Page URL.', 'roland' )),
	) );
}