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

	/*=========================================
	top header
	=========================================*/
	$wp_customize->add_section(
        'expert_bakers_shop_topbar',
        array(
        	'priority'      => 2,
            'title' 		=> __('Header Informations','expert-bakers-shop'),
			'panel'  		=> 'expert_bakers_shop_frontpage_sections',
		)
    );
    
	$wp_customize->add_setting('expert_bakers_shop_call_text',array(
		'default'=> 'Call Us',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('expert_bakers_shop_call_text',array(
		'label'	=> __('Add Call Text','expert-bakers-shop'),
		'section'=> 'expert_bakers_shop_topbar',
		'type'=> 'text'
	));

	$wp_customize->add_setting('expert_bakers_shop_call',array(
		'default'=> '+1800 123 4567',
		'sanitize_callback'	=> 'expert_bakers_shop_sanitize_phone_number'
	));
	$wp_customize->add_control('expert_bakers_shop_call',array(
		'label'	=> __('Add Phone Number','expert-bakers-shop'),
		'section'=> 'expert_bakers_shop_topbar',
		'type'=> 'text'
	));

	$wp_customize->add_setting('expert_bakers_shop_mail_text',array(
		'default'=> 'Mail Us',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('expert_bakers_shop_mail_text',array(
		'label'	=> __('Add Mail Text','expert-bakers-shop'),
		'section'=> 'expert_bakers_shop_topbar',
		'type'=> 'text'
	));

	$wp_customize->selective_refresh->add_partial( 'expert_bakers_shop_mail_text', array(
		'selector' => '.email',
		'render_callback' => 'Expert_Bakers_Shop_Customize_partial_expert_bakers_shop_mail_text',
	) );
	
	$wp_customize->add_setting('expert_bakers_shop_mail',array(
		'default'=> 'info@example.com',
		'sanitize_callback'	=> 'sanitize_email'
	));
	$wp_customize->add_control('expert_bakers_shop_mail',array(
		'label'	=> __('Add Mail Address','expert-bakers-shop'),
		'section'=> 'expert_bakers_shop_topbar',
		'type'=> 'text'
	));

	$wp_customize->add_setting('expert_bakers_shop_location_text',array(
		'default'=> 'Address',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('expert_bakers_shop_location_text',array(
		'label'	=> __('Add Location Text','expert-bakers-shop'),
		'section'=> 'expert_bakers_shop_topbar',
		'type'=> 'text'
	));

	$wp_customize->add_setting('expert_bakers_shop_location',array(
		'default'=> '99 S.t Jomblo Park Pekanbaru',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('expert_bakers_shop_location',array(
		'label'	=> __('Add location','expert-bakers-shop'),
		'section'=> 'expert_bakers_shop_topbar',
		'type'=> 'text'
	));

	$wp_customize->add_setting('expert_bakers_shop_open_time_text',array(
		'default'=> 'Open Hours',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('expert_bakers_shop_open_time_text',array(
		'label'	=> __('Add Opening Time Text','expert-bakers-shop'),
		'section'=> 'expert_bakers_shop_topbar',
		'type'=> 'text'
	));

	$wp_customize->add_setting('expert_bakers_shop_open_time',array(
		'default'=> 'Mon-Fri: 08:00am-6:00pm',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('expert_bakers_shop_open_time',array(
		'label'	=> __('Add Timing','expert-bakers-shop'),
		'section'=> 'expert_bakers_shop_topbar',
		'type'=> 'text'
	));

	$wp_customize->add_setting( 'expert_bakers_shop_upgrade_page_settings_589cs',
	array(
		'sanitize_callback' => 'sanitize_text_field'
	)
	);
	$wp_customize->add_control( new Expert_Bakers_Shop_Control_Upgrade(
		$wp_customize, 'expert_bakers_shop_upgrade_page_settings_589cs',
			array(
				'priority'      => 200,
				'section'       => 'expert_bakers_shop_topbar',
				'settings'      => 'expert_bakers_shop_upgrade_page_settings_589cs',
				'label'         => __( 'Expert Bakers Shop Pro comes with additional features.', 'expert-bakers-shop' ),
				'choices'       => array( __( '15+ Ready-Made Sections', 'expert-bakers-shop' ), __( 'One-Click Demo Import', 'expert-bakers-shop' ), __( 'WooCommerce Integrated', 'expert-bakers-shop' ), __( 'Drag & Drop Section Reordering', 'expert-bakers-shop' ),__( 'Advanced Typography Control', 'expert-bakers-shop' ),__( 'Intuitive Customization Options', 'expert-bakers-shop' ),__( '24/7 Support', 'expert-bakers-shop' ), )
			)
		)
	);

	// Social Link
	$wp_customize->add_section( 'expert_bakers_shop_social_media', array(
    	'title'      => __( 'Social Media Links', 'expert-bakers-shop' ),
    	'description' => __( 'Add your Social Links', 'expert-bakers-shop' ),
		'panel' => 'expert_bakers_shop_frontpage_sections',
      'priority' => 2,
	) );

	$wp_customize->add_setting('expert_bakers_shop_facebook_url',array(
		'default'=> '#',
		'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('expert_bakers_shop_facebook_url',array(
		'label'	=> __('Facebook Link','expert-bakers-shop'),
		'section'=> 'expert_bakers_shop_social_media',
		'type'=> 'url'
	));

	$wp_customize->add_setting('expert_bakers_shop_twitter_url',array(
		'default'=> '#',
		'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('expert_bakers_shop_twitter_url',array(
		'label'	=> __('Twitter Link','expert-bakers-shop'),
		'section'=> 'expert_bakers_shop_social_media',
		'type'=> 'url'
	));
	
	$wp_customize->add_setting('expert_bakers_shop_instagram_url',array(
		'default'=> '#',
		'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('expert_bakers_shop_instagram_url',array(
		'label'	=> __('Instagram Link','expert-bakers-shop'),
		'section'=> 'expert_bakers_shop_social_media',
		'type'=> 'url'
	));

	$wp_customize->add_setting('expert_bakers_shop_youtube_url',array(
		'default'=> '#',
		'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('expert_bakers_shop_youtube_url',array(
		'label'	=> __('Youtube Link','expert-bakers-shop'),
		'section'=> 'expert_bakers_shop_social_media',
		'type'=> 'url'
	));

	$wp_customize->add_setting( 'expert_bakers_shop_upgrade_page_settings_589',
	array(
		'sanitize_callback' => 'sanitize_text_field'
	)
	);
	$wp_customize->add_control( new Expert_Bakers_Shop_Control_Upgrade(
		$wp_customize, 'expert_bakers_shop_upgrade_page_settings_589',
			array(
				'priority'      => 200,
				'section'       => 'expert_bakers_shop_social_media',
				'settings'      => 'expert_bakers_shop_upgrade_page_settings_589',
				'label'         => __( 'Expert Bakers Shop Pro comes with additional features.', 'expert-bakers-shop' ),
				'choices'       => array( __( '15+ Ready-Made Sections', 'expert-bakers-shop' ), __( 'One-Click Demo Import', 'expert-bakers-shop' ), __( 'WooCommerce Integrated', 'expert-bakers-shop' ), __( 'Drag & Drop Section Reordering', 'expert-bakers-shop' ),__( 'Advanced Typography Control', 'expert-bakers-shop' ),__( 'Intuitive Customization Options', 'expert-bakers-shop' ),__( '24/7 Support', 'expert-bakers-shop' ), )
			)
		)
	);

}
add_action( 'customize_register', 'expert_bakers_shop_upper_header_settings' );