<?php

function bexplore_contact_settings_register( $wp_customize ) {

	// Panel: Basic.
	$wp_customize->add_panel('be_panel_wpcustomize', array(
		'priority' => 10,
		'title' => __('Contact Info', 'bexplore'),
		'description' => __('Panel Description', 'bexplore'),
		'capability' => 'edit_theme_options'
	));

	/**
	 * Breadcrumb
	 *
	 * @since 1.0.0
	 */
	$wp_customize->add_section(
		'bexplore_header_top_section',
		array(
			'title' => __('Header Top settings', 'bexplore'),
			'description' => __('Show/Hide option for Header Top Area.', 'bexplore'),
			'priority' => 5,
			'panel' => 'be_panel_wpcustomize',
		)
	);

	$wp_customize->add_setting(
		'bexplore_header_top_on_off',
		array(
			'default' => 'show',
			'transport' => 'refresh',
			'sanitize_callback' => 'bexplore_sanitize_switch_option',
		)
	);
	$wp_customize->add_control(
		'bexplore_header_top_on_off',
		array(
			'type' => 'select',
			'label' => esc_html__('Header Top Area', 'bexplore'),
			'description' => esc_html__('Show/Hide option for breadcrumb.', 'bexplore'),
			'section' => 'bexplore_header_top_section',
			'priority' => 10,
			'choices' => array(
				'show' => esc_html__('Show', 'bexplore'),
				'hide' => esc_html__('Hide', 'bexplore'),
			),
		)
	);
	/**
	 * Header section
	 */
	$wp_customize->add_section('bexplore_header_section',
		array(
			'title' => __('Header Section', 'bexplore'),
			'priority' => 150,
			'panel' => 'be_panel_wpcustomize',
		)
	);
	/**
	 * Contact section
	 */
	$wp_customize->add_section('bexplore_contact_options',
		array(
			'title' => __('Contact Option', 'bexplore'),
			'priority' => 150,
			'panel' => 'be_panel_wpcustomize',
		)
	);
	/**
	 * Contact setting
	 */
	$wp_customize->add_setting('bexplore_phone',
		array(
			'default' => __('+0123456789', 'bexplore'),
			'sanitize_callback' => 'sanitize_text_field',
			'transport' => 'refresh',
		)
	);

	$wp_customize->add_setting('bexplore_email',
		array(
			'default' => __('exmaple@mail.com', 'bexplore'),
			'sanitize_callback' => 'sanitize_email',
			'transport' => 'refresh',
		)
	);

	/**
	 * Contact control
	 */
	$wp_customize->add_control('bexplore_email',
		array(
			'type' => 'text',
			'priority' => 150,
			'section' => 'bexplore_contact_options',
			'label' => __('Email Address','bexplore')
		)
	);
	$wp_customize->add_control('bexplore_phone',
		array(
			'type' => 'text',
			'priority' => 150,
			'section' => 'bexplore_contact_options',
			'label' => __('Phone Number','bexplore')
		)
	);



	/**
	 * Social section
	 */
	$wp_customize->add_section('bexplore_social_options',
		array(
			'title' => __('Social Profile', 'bexplore'),
			'priority' => 150,
			'panel' => 'be_panel_wpcustomize',
		)
	);

	/**
	 * Social setting
	 */
	$wp_customize->add_setting('bexplore_facebook',
		array(
			'default' => __('https://www.facebook.com/', 'bexplore'),
			'sanitize_callback' => 'sanitize_url',
			'transport' => 'refresh',
		)
	);
	$wp_customize->add_setting('bexplore_twitter',
		array(
			'default' => __('https://www.twitter.com/', 'bexplore'),
			'sanitize_callback' => 'sanitize_url',
			'transport' => 'refresh',
		)
	);
	$wp_customize->add_setting('bexplore_instagram',
		array(
			'default' => __('https://www.instagram.com/', 'bexplore'),
			'sanitize_callback' => 'sanitize_url',
			'transport' => 'refresh',
		)
	);
	$wp_customize->add_setting('bexplore_youtube',
		array(
			'default' => __('https://www.youtube.com/', 'bexplore'),
			'sanitize_callback' => 'sanitize_url',
			'transport' => 'refresh',
		)
	);
	/**
	 * Social control
	 */
	$wp_customize->add_control('bexplore_facebook',
		array(
			'type' => 'text',
			'priority' => 150,
			'section' => 'bexplore_social_options',
			'label' => __('Facebook','bexplore')
		)
	);
	$wp_customize->add_control('bexplore_twitter',
		array(
			'type' => 'text',
			'priority' => 150,
			'section' => 'bexplore_social_options',
			'label' => __('Twitter', 'bexplore')
		)
	);
	$wp_customize->add_control('bexplore_instagram',
		array(
			'type' => 'text',
			'priority' => 150,
			'section' => 'bexplore_social_options',
			'label' => __('Instagram', 'bexplore')
		)
	);
	$wp_customize->add_control('bexplore_youtube',
		array(
			'type' => 'text',
			'priority' => 150,
			'section' => 'bexplore_social_options',
			'label' => __('Youtube', 'bexplore')
		)
	);

	// Setting: Select.
	$wp_customize->add_setting('be_select', array(
		'type' => 'theme_mod',
		'default' => 'enable',
		'transport' => 'refresh',
		'capability' => 'edit_theme_options',
		'sanitize_callback' => 'be_sanitize_select'
	));

	// Control: Select.
	$wp_customize->add_control('be_select', array(
		'label' => __('Select', 'bexplore'),
		'description' => __('Description', 'bexplore'),
		'section' => 'be_section_basic',
		'type' => 'select',
		'choices' => array(
			'enable' => 'Enable',
			'disable' => 'Disable'
		)
	));
}
add_action( 'customize_register', 'bexplore_contact_settings_register' );