<?php 
$wp_customize->add_section( 'roland_services_section', array(
	'capability'            => 'edit_theme_options',
	'priority'              => 3,
	'title'                 => __( 'Our Services', 'roland' ),
	'description'           => __( 'Services section', 'roland' ),
	'panel'                 => 'roland_front_option'
) );

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

$wp_customize->add_control( 'roland_service_enable',
  array(
    'label'         => esc_html__( 'Show Services Section', 'roland' ),
    'section'       => 'roland_services_section',
    'type'          => 'checkbox',
    'priority'      => 1,
  )
);

// Service Section Title
$wp_customize->add_setting( 'roland_s_bg_title', array(
    'capability'            => 'edit_theme_options',
    'default'               => '',
    'sanitize_callback'     => 'sanitize_text_field'
) );

$wp_customize->add_control( 'roland_s_bg_title', array(
    'label'                 =>  __( 'Section Top BG Title', 'roland' ),
    'section'               => 'roland_services_section',
    'type'                  => 'text',
    'settings'              => 'roland_s_bg_title',
) );

$wp_customize->add_setting( 'roland_s_title', array(
    'capability'            => 'edit_theme_options',
    'default'               => '',
    'sanitize_callback'     => 'sanitize_text_field'
) );

$wp_customize->add_control( 'roland_s_title', array(
    'label'                 =>  __( 'Section title', 'roland' ),
    'section'               => 'roland_services_section',
    'type'                  => 'text',
    'settings'              => 'roland_s_title',
) );

$wp_customize->add_setting( 'roland_s_content', array(
    'capability'            => 'edit_theme_options',
    'default'               => '',
    'sanitize_callback'     => 'sanitize_text_field'
) );

$wp_customize->add_control( 'roland_s_content', array(
    'label'                 =>  __( 'Section content', 'roland' ),
    'section'               => 'roland_services_section',
    'type'                  => 'text',
    'settings'              => 'roland_s_content',
) );

$wp_customize->add_setting( 'roland_s_icon', array(
    'capability'            => 'edit_theme_options',
    'default'               => '',
    'sanitize_callback'     => 'wp_filter_nohtml_kses'
) );

$wp_customize->add_control( 'roland_s_icon', array(
    'label'                 =>  __( 'Type section Icon', 'roland' ),
    'section'               => 'roland_services_section',
    'type'                  => 'text',
	'description'           => sprintf( esc_html( 'Type Icofont Icon: Eg: [icofont-ambulance-cross]', 'roland' )),
    'settings'              => 'roland_s_icon',
) );



// Services Customizer
$roland_service_array = array(
	'1'=>'icofont-ambulance-cross',
	'2'=>'icofont-phone',
	'3'=>'icofont-user',
);
foreach ($roland_service_array as $roland_key => $roland_service) {

$wp_customize->add_setting( 'roland_service_page_'.$roland_key, array(
    'capability'            => 'edit_theme_options',
    'default'               => '',
    'sanitize_callback'     => 'roland_sanitize_dropdown_pages'
) );

$wp_customize->add_control( 'roland_service_page_'.$roland_key, array(
   	 /* translators: %s: Label */ 
    'label'                 => sprintf( __( 'Select page  %1$s', 'roland' ), $roland_key),
    'section'               => 'roland_services_section',
    'type'                  => 'dropdown-pages',
    'settings'              => 'roland_service_page_'.$roland_key,
) );

$wp_customize->add_setting( 'roland_service_icon_'.$roland_key, array(
    'capability'            => 'edit_theme_options',
    'default'               => '',
    'sanitize_callback'     => 'sanitize_text_field'
) );

$wp_customize->add_control( 'roland_service_icon_'.$roland_key, array(
	 /* translators: %s: Label */ 
    'label'                 => sprintf( __( 'Type icon %1$s', 'roland' ), $roland_key),
    /* translators: %s: Description */ 
    'description'           => sprintf( __( 'Use font awesome icon: Eg: %1$s. %2$s See more here %3$s', 'roland' ), $roland_service,'<a href="'.esc_url('https://icofont.com/icons').'">','</a>'),
    'section'               => 'roland_services_section',
    'type'                  => 'text',
    'settings' => 'roland_service_icon_'.$roland_key,
) );
}