<?php 
$wp_customize->add_section( 'buconz_starter_services_section', array(
	'capability'            => 'edit_theme_options',
	'priority'              => 4,
	'title'                 => __( 'Our Services', 'buconz-starter' ),
	'description'           => __( 'Services section', 'buconz-starter' ),
	'panel'                 => 'buconz_starter_front_option'
) );

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

$wp_customize->add_control( 'buconz_starter_service_enable',
  array(
    'label'         => esc_html__( 'Show Services Section', 'buconz-starter' ),
    'section'       => 'buconz_starter_services_section',
    'type'          => 'checkbox',
    'priority'      => 1,
  )
);

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

$wp_customize->add_control( 'buconz_starter_service_top_title', array(
    'label'                 =>  __( 'Service section top badge', 'buconz-starter' ),
    'section'               => 'buconz_starter_services_section',
    'type'                  => 'text',
    'settings'              => 'buconz_starter_service_top_title',
) );

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

$wp_customize->add_control( 'buconz_starter_service_title', array(
    'label'                 =>  __( 'Service section title', 'buconz-starter' ),
    'section'               => 'buconz_starter_services_section',
    'type'                  => 'text',
    'settings'              => 'buconz_starter_service_title',
) );

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

$wp_customize->add_control( 'buconz_starter_service_content', array(
    'label'                 =>  __( 'Service section description', 'buconz-starter' ),
    'section'               => 'buconz_starter_services_section',
    'type'                  => 'text',
    'settings'              => 'buconz_starter_service_content',
) );

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

$wp_customize->add_control( 'buconz_starter_service_content', array(
    'label'                 =>  __( 'Type Section Description', 'buconz-starter' ),
    'section'               => 'buconz_starter_services_section',
    'type'                  => 'text',
    'settings'              => 'buconz_starter_service_content',
) );



// Services Customizer
$buconz_starter_service_array = array(
	'1'=>'fa fa-money',
	'2'=>'fa fa-handshake-o',
	'3'=>'fa fa-hospital-o',
);
foreach ($buconz_starter_service_array as $buconz_starter_key => $buconz_starter_service) {

$wp_customize->add_setting( 'buconz_starter_service_page_'.$buconz_starter_key, array(
    'capability'            => 'edit_theme_options',
    'default'               => '',
    'sanitize_callback'     => 'buconz_starter_sanitize_dropdown_pages'
) );

$wp_customize->add_control( 'buconz_starter_service_page_'.$buconz_starter_key, array(
   	 /* translators: %s: Label */ 
    'label'                 => sprintf( __( 'Select page  %1$s', 'buconz-starter' ), $buconz_starter_key),
    'section'               => 'buconz_starter_services_section',
    'type'                  => 'dropdown-pages',
    'settings'              => 'buconz_starter_service_page_'.$buconz_starter_key,
) );

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

$wp_customize->add_control( 'buconz_starter_service_icon_'.$buconz_starter_key, array(
	 /* translators: %s: Label */ 
    'label'                 => sprintf( __( 'Type icon %1$s', 'buconz-starter' ), $buconz_starter_key),
    /* translators: %s: Description */ 
    'description'           => sprintf( __( 'Use font awesome icon: Eg: %1$s. %2$s See more here %3$s', 'buconz-starter' ), $buconz_starter_service,'<a href="'.esc_url('http://fontawesome.io/icons/').'">','</a>'),
    'section'               => 'buconz_starter_services_section',
    'type'                  => 'text',
    'settings' => 'buconz_starter_service_icon_'.$buconz_starter_key,
) );
}