<?php
function expert_digital_agency_upper_header_settings( $wp_customize ) {
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';

	/*=========================================
	Social Media
	=========================================*/
	$wp_customize->add_section(
        'expert_digital_agency_upper_header',
        array(
        	'priority'      => 3,
            'title' 		=> __('Header Information','expert-digital-agency'),
			'panel'  		=> 'expert_digital_agency_frontpage_sections',
		)
    );

    // Slider Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'expert_digital_agency_display_topbar' , 
			array(
			'default' => true,
			'sanitize_callback' => 'expert_digital_agency_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	
	$wp_customize->add_control(
	'expert_digital_agency_display_topbar', 
		array(
			'label'	      => esc_html__( 'Show / Hide Top Header', 'expert-digital-agency' ),
			'section'     => 'expert_digital_agency_upper_header',
			'settings'    => 'expert_digital_agency_display_topbar',
			'type'        => 'checkbox'
		) 
	);

	$wp_customize->add_setting(
    	'expert_digital_agency_topheader_location',
    	array(
			'default' => '121 King Street, Melbourne, Australia',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		'expert_digital_agency_topheader_location',
		array(
		    'label'   		=> __('Add Location','expert-digital-agency'),
		    'section'		=> 'expert_digital_agency_upper_header',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)
	);

	$wp_customize->add_setting(
		'expert_digital_agency_call',
		array(
			'default'=> '+00 123 456 7890',
			'sanitize_callback'	=> 'expert_digital_agency_sanitize_phone_number'
		)
	);

	$wp_customize->add_control(
		'expert_digital_agency_call',array(
			'label'	=> __('Add Phone Number','expert-digital-agency'),
			'section'=> 'expert_digital_agency_upper_header',
			'type'=> 'text'
		)
	);

	$wp_customize->add_setting(
    	'expert_digital_agency_topheader_email_text',
    	array(
			'default' => 'EMAIL',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		'expert_digital_agency_topheader_email_text',
		array(
		    'label'   		=> __('Add Email Text','expert-digital-agency'),
		    'section'		=> 'expert_digital_agency_upper_header',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)
	);

	$wp_customize->add_setting(
    	'expert_digital_agency_topheader_email',
    	array(
			'default' => 'xyz123@example.com',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		'expert_digital_agency_topheader_email',
		array(
		    'label'   		=> __('Add Email','expert-digital-agency'),
		    'section'		=> 'expert_digital_agency_upper_header',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)
	);

	$wp_customize->add_setting(
    	'expert_digital_agency_header_btn_text',
    	array(
			'default' => 'REQUEST A FREE QUOTE',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		'expert_digital_agency_header_btn_text',
		array(
		    'label'   		=> __('Button Text','expert-digital-agency'),
		    'section'		=> 'expert_digital_agency_upper_header',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);

	$wp_customize->add_setting(
    	'expert_digital_agency_header_btn_link',
    	array(
			'default' => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control( 
		'expert_digital_agency_header_btn_link',
		array(
		    'label'   		=> __('Button Link','expert-digital-agency'),
		    'section'		=> 'expert_digital_agency_upper_header',
			'type' 			=> 'url',
			'transport'         => $selective_refresh,
		)
	);


	$wp_customize->add_setting( 'expert_digital_agency_upgrade_page_settings_12',
        array(
            'sanitize_callback' => 'sanitize_text_field'
        )
    );
    $wp_customize->add_control( new Expert_Digital_Agency_Control_Upgrade(
        $wp_customize, 'expert_digital_agency_upgrade_page_settings_12',
            array(
                'priority'      => 200,
                'section'       => 'expert_digital_agency_upper_header',
                'settings'      => 'expert_digital_agency_upgrade_page_settings_12',
                'label'         => __( 'Digital Agency Pro comes with additional features.', 'expert-digital-agency' ),
                'choices'       => array( __( '15+ Ready-Made Sections', 'expert-digital-agency' ), __( 'One-Click Demo Import', 'expert-digital-agency' ), __( 'WooCommerce Integrated', 'expert-digital-agency' ), __( 'Drag & Drop Section Reordering', 'expert-digital-agency' ),__( 'Advanced Typography Control', 'expert-digital-agency' ),__( 'Intuitive Customization Options', 'expert-digital-agency' ),__( '24/7 Support', 'expert-digital-agency' ), )
            )
        )
    );
}
add_action( 'customize_register', 'expert_digital_agency_upper_header_settings' );