<?php
/**
 * Testimonial Settings
 *
 * @package relax_spa
 */
add_action( 'customize_register', 'relax_spa_customize_testimonials_section' );

function relax_spa_customize_testimonials_section( $wp_customize )
{
    $wp_customize->add_section('relax_spa_testimonial_sections', array(
        'title' => esc_html__('Testimonial Section', 'relax-spa'),
        'description' => esc_html__('Testimonial Section :', 'relax-spa'),
        'panel' => 'relax_spa_homepage_panel'
    ));

    $wp_customize->add_setting('bs_testimonial_display_option', array(
        'sanitize_callback' => 'relax_spa_sanitize_checkbox',
        'default' => true
    ));

    $wp_customize->add_control(new Relax_Spa_Toggle_Control($wp_customize, 'bs_testimonial_display_option', array(
        'label' => esc_html__('Hide / Show', 'relax-spa'),
        'section' => 'relax_spa_testimonial_sections',
        'type'=> 'relax-spa-toggle',
    )));

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

    $wp_customize->add_control('bs_top_heading_for_testimonial', array(
        'label' => esc_html__('Enter Top Heading for Testimonial', 'relax-spa'),
        'section' => 'relax_spa_testimonial_sections',
        'type' => 'text',
    ));

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

    $wp_customize->add_control('bs_heading_for_testimonial', array(
        'label' => esc_html__('Enter Main Heading for Testimonial', 'relax-spa'),
        'section' => 'relax_spa_testimonial_sections',
        'type' => 'text',
    ));

    $wp_customize->add_setting( 'bs_image_for_testimonial', array(
        'sanitize_callback'     =>  'relax_spa_sanitize_image',
    ) );

    $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'bs_image_for_testimonial', array(
        'label'      => esc_html__( 'Image', 'relax-spa' ),
        'section'    => 'relax_spa_testimonial_sections',
        'settings'   => 'bs_image_for_testimonial',
    ) ) );

    $wp_customize->selective_refresh->add_partial( 'bs_testimonial_display_option', array(
        'selector' => '.testimonial > .container',
      ) ); 

}