<?php 
// Global Customize Option
$wp_customize->add_section( 'roland_theme_global', array(
	'capability'            => 'edit_theme_options',
	'priority'              => 1,
	'title'                 => __( 'Theme Global', 'roland' ),
	'description'           => __( 'Theme Global Settings', 'roland' ),
	'panel'                 => 'roland_theme_settings'
) );

$wp_customize->add_setting( 'roland_topbar_enable',
  array(
    'default'           => false,
    'sanitize_callback'     => 'roland_sanitize_checkbox'
  )
);

$wp_customize->add_control( 'roland_topbar_enable',
  array(
    'label'         => esc_html__( 'Enable topbar?', 'roland' ),
    'section'       => 'roland_theme_global',
    'type'          => 'checkbox',
  )
);

// Header Address
$roland_contact_arrays =  array('1'=>'icofont-phone', '2'=>'icofont-ui-email', '3'=>'icofont-location-pin',);
foreach($roland_contact_arrays as $roland_key => $roland_address){

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

$wp_customize->add_control( 'roland_topbar_icon_'.$roland_key, array(
	/* translators: %s: Label */ 
    'label'                 =>   sprintf( __( 'Type contact icon %s', 'roland' ), $roland_key ),
    /* translators: %s: Description */ 
    'description'           => sprintf( __( 'Use icon: Eg: %1$s. %2$s See more here %3$s', 'roland' ), $roland_address,'<a href="'.esc_url('https://icofont.com/how-to-use').'">','</a>'),
    'section'               => 'roland_theme_global',
    'type'                  => 'text',
    'settings' => 'roland_topbar_icon_'.$roland_key,
) );	

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

$wp_customize->add_control( 'roland_topbar_contact_'.$roland_key, array(
	/* translators: %s: Description */ 
    'label'                 =>   sprintf( __( 'Type contact Title %s', 'roland' ), $roland_key ),
    'section'               => 'roland_theme_global',
    'type'                  => 'text',
    'settings' => 'roland_topbar_contact_'.$roland_key,
) );


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

$wp_customize->add_control( 'roland_topbar_contact_desc'.$roland_key, array(
	/* translators: %s: Description */ 
    'label'                 =>   sprintf( __( 'Type contact Description %s', 'roland' ), $roland_key ),
    'section'               => 'roland_theme_global',
    'type'                  => 'text',
    'settings' => 'roland_topbar_contact_desc'.$roland_key,
) );

}

//	Emergency Title
$wp_customize->add_setting( 'roland_emergency_title', array(
    'capability'            => 'edit_theme_options',
    'default'               => 'Emergency Cases',
    'sanitize_callback'     => 'sanitize_text_field'
) );

$wp_customize->add_control( 'roland_emergency_title', array(
    'label'                 =>  __( 'Emergency Cases Title', 'roland' ),
    'section'               => 'roland_theme_global',
    'type'                  => 'text',
    'settings'              => 'roland_emergency_title',
) );

//	CTA Content
$wp_customize->add_setting( 'roland_emergency_number', array(
    'capability'            => 'edit_theme_options',
    'default'               => '1-258-985-703',
    'sanitize_callback'     => 'sanitize_text_field'
) );

$wp_customize->add_control( 'roland_emergency_number', array(
    'label'                 =>  __( 'Emergency Cases Number', 'roland' ),
    'section'               => 'roland_theme_global',
    'type'                  => 'text',
    'settings'              => 'roland_emergency_number',
) );

// Default Post Expert
$wp_customize->add_setting( 'roland_post_excerpt', array(
    'capability'            => 'edit_theme_options',
    'default'               => 22,
    'sanitize_callback'     => 'absint'
) );

$wp_customize->add_control( 'roland_post_excerpt', array(
    'label'                 =>  __( 'Post Excerpt Limit', 'roland' ),
	'description'            => __( 'Customize post excerpt limit, global limit is : 22', 'roland' ),
    'section'               => 'roland_theme_global',
    'settings'              => 'roland_post_excerpt',
    'type'                  => 'text',
) );

