<?php
/**
 * General Settings
    *
    * @package relax_spa
 */


add_action( 'customize_register', 'relax_spa_customize_general_option' );

function relax_spa_customize_general_option( $wp_customize ) {

    $wp_customize->add_section( 'relax_spa_general_section', array(
        'title'         => esc_html__( 'General Options', 'relax-spa' ),
        'description'   => esc_html__( 'General Options', 'relax-spa' ),
        'panel'         => 'relax_spa_header_panel',
        'priority'      => 10,
    ) );

    $wp_customize->add_setting( 'relax_spa_contact_number', array(   
        'sanitize_callback' => 'sanitize_text_field',
        'default'     => '',
    ) );

    $wp_customize->add_control( 'relax_spa_contact_number', array(
        'label' => esc_html__( 'Contact Number', 'relax-spa' ),
        'section' => 'relax_spa_general_section',
        'settings' => 'relax_spa_contact_number',
        'type'=> 'text',
    ) );

    $wp_customize->selective_refresh->add_partial( 'relax_spa_contact_number', array(
	    'selector' => '.top-header .phone',
        
	) );

    $wp_customize->add_setting( 'relax_spa_email_address', array( 
        'transport' => 'postMessage',  
        'sanitize_callback' => 'sanitize_text_field',
    ) );

    $wp_customize->add_control( 'relax_spa_email_address', array(
        'label' => esc_html__( 'Email Address', 'relax-spa' ),
        'section' => 'relax_spa_general_section',
        'settings' => 'relax_spa_email_address',
        'type'=> 'text',
    ) );

    $wp_customize->selective_refresh->add_partial( 'relax_spa_email_address', array(
	    'selector' => '.top-header .email',
        
	) );

    $wp_customize->add_setting('bs_header_cta_label', array(
        'sanitize_callback' => 'sanitize_text_field',
        'transport' => 'postMessage',
        'default' => ''
    ));

    $wp_customize->add_control('bs_header_cta_label', array(
        'label' => esc_html__('Cta Button Label', 'relax-spa'),
        'section' => 'relax_spa_general_section',
        'type' => 'text',
    ));

    $wp_customize->selective_refresh->add_partial( 'bs_header_cta_label', array(
	    'selector' => '.top-header .book-btn',
        
	) );

    $wp_customize->add_setting('bs_header_cta_link', array(
        'sanitize_callback' => 'esc_url_raw',
        'default' => ''
    ));

    $wp_customize->add_control('bs_header_cta_link', array(
        'label' => esc_html__('Cta Button Link', 'relax-spa'),
        'section' => 'relax_spa_general_section',
        'type' => 'url',
    ));
}