<?php
/**
 * Massage Wellness Retreat Theme Customizer
 *
 * @package Massage Wellness Retreat
 */

function Massage_Wellness_Retreat_Customize_register( $wp_customize ) {
	$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
	$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';

	if ( isset( $wp_customize->selective_refresh ) ) {
		$wp_customize->selective_refresh->add_partial(
			'blogname',
			array(
				'selector'        => '.site-title a',
				'render_callback' => 'Massage_Wellness_Retreat_Customize_partial_blogname',
			)
		);
		$wp_customize->selective_refresh->add_partial(
			'blogdescription',
			array(
				'selector'        => '.site-description',
				'render_callback' => 'Massage_Wellness_Retreat_Customize_partial_blogdescription',
			)
		);
	}

	/*
    * Theme Options Panel
    */
	$wp_customize->add_panel('massage_wellness_retreat_panel', array(
		'priority' => 25,
		'capability' => 'edit_theme_options',
		'title' => __('Theme Options', 'massage-wellness-retreat'),
	));

	/*
	* Customizer main header section
	*/

	$wp_customize->add_setting(
		'massage_wellness_retreat_site_title_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_site_title_text',
		array(
			'label'       => __('Enable Title', 'massage-wellness-retreat'),
			'description' => __('Enable or Disable Title from the site', 'massage-wellness-retreat'),
			'section'     => 'title_tagline',
			'type'        => 'checkbox',
		)
	);

	$wp_customize->add_setting(
		'massage_wellness_retreat_site_tagline_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 0,
			'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_site_tagline_text',
		array(
			'label'       => __('Enable Tagline', 'massage-wellness-retreat'),
			'description' => __('Enable or Disable Tagline from the site', 'massage-wellness-retreat'),
			'section'     => 'title_tagline',
			'type'        => 'checkbox',
		)
	);

		$wp_customize->add_setting(
		'massage_wellness_retreat_logo_width',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '150',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_logo_width',
		array(
			'label'       => __('Logo Width in PX', 'massage-wellness-retreat'),
			'section'     => 'title_tagline',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 100,
	             'max' => 300,
	             'step' => 1,
	         ),
		)
	);

	/* WooCommerce custom settings */

	$wp_customize->add_section('woocommerce_custom_settings', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('WooCommerce Custom Settings', 'massage-wellness-retreat'),
		'panel'       => 'woocommerce',
	));

	$wp_customize->add_setting(
		'massage_wellness_retreat_per_columns',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '3',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_per_columns',
		array(
			'label'       => __('Product Per Single Row', 'massage-wellness-retreat'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 4,
	             'step' => 1,
	         ),
		)
	);

	$wp_customize->add_setting(
		'massage_wellness_retreat_product_per_page',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '6',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_product_per_page',
		array(
			'label'       => __('Product Per One Page', 'massage-wellness-retreat'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 12,
	             'step' => 1,
	         ),
		)
	);

	/*Related Products Enable Option*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_enable_related_product',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_enable_related_product',
		array(
			'label'       => __('Enable Related Product', 'massage-wellness-retreat'),
			'description' => __('Checked to show Related Product', 'massage-wellness-retreat'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'checkbox',
		)
	);

	$wp_customize->add_setting(
		'custom_related_products_number',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '3',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'custom_related_products_number',
		array(
			'label'       => __('Related Product Count', 'massage-wellness-retreat'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 20,
	             'step' => 1,
	         ),
		)
	);

	$wp_customize->add_setting(
		'custom_related_products_number_per_row',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '3',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'custom_related_products_number_per_row',
		array(
			'label'       => __('Related Product Per Row', 'massage-wellness-retreat'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 4,
	             'step' => 1,
	         ),
		)
	);

	/*Archive Product layout*/
	$wp_customize->add_setting('massage_wellness_retreat_archive_product_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'massage_wellness_retreat_sanitize_choices'
	));
	$wp_customize->add_control('massage_wellness_retreat_archive_product_layout',array(
        'type' => 'select',
        'label' => esc_html__('Archive Product Layout','massage-wellness-retreat'),
        'section' => 'woocommerce_custom_settings',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','massage-wellness-retreat'),
            'layout-2' => esc_html__('Sidebar On Left','massage-wellness-retreat'),
			'layout-3' => esc_html__('Full Width Layout','massage-wellness-retreat')
        ),
	) );

	/*Single Product layout*/
	$wp_customize->add_setting('massage_wellness_retreat_single_product_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'massage_wellness_retreat_sanitize_choices'
	));
	$wp_customize->add_control('massage_wellness_retreat_single_product_layout',array(
        'type' => 'select',
        'label' => esc_html__('Single Product Layout','massage-wellness-retreat'),
        'section' => 'woocommerce_custom_settings',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','massage-wellness-retreat'),
            'layout-2' => esc_html__('Sidebar On Left','massage-wellness-retreat'),
			'layout-3' => esc_html__('Full Width Layout','massage-wellness-retreat')
        ),
	) );

	$wp_customize->add_setting('massage_wellness_retreat_woocommerce_product_sale',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
        'default'           => 'Right',
        'sanitize_callback' => 'massage_wellness_retreat_sanitize_choices'
    ));
    $wp_customize->add_control('massage_wellness_retreat_woocommerce_product_sale',array(
        'label'       => esc_html__( 'Woocommerce Product Sale Positions','massage-wellness-retreat' ),
        'type' => 'select',
        'section' => 'woocommerce_custom_settings',
        'choices' => array(
            'Right' => __('Right','massage-wellness-retreat'),
            'Left' => __('Left','massage-wellness-retreat'),
            'Center' => __('Center','massage-wellness-retreat')
        ),
    ) );

	/*Additional Options*/
	$wp_customize->add_section('massage_wellness_retreat_additional_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Additional Options', 'massage-wellness-retreat'),
		'panel'       => 'massage_wellness_retreat_panel',
	));

	/*Main Slider Enable Option*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_enable_sticky_header',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => false,
			'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_enable_sticky_header',
		array(
			'label'       => __('Enable Sticky Header', 'massage-wellness-retreat'),
			'description' => __('Checked to enable sticky header', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_additional_section',
			'type'        => 'checkbox',
		)
	);

	/*Main Slider Enable Option*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_enable_preloader',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 0,
			'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_enable_preloader',
		array(
			'label'       => __('Enable Preloader', 'massage-wellness-retreat'),
			'description' => __('Checked to show preloader', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_additional_section',
			'type'        => 'checkbox',
		)
	);
	
	/*Breadcrumbs Enable Option*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_enable_breadcrumbs',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_enable_breadcrumbs',
		array(
			'label'       => __('Enable Breadcrumbs', 'massage-wellness-retreat'),
			'description' => __('Checked to show Breadcrumbs', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_additional_section',
			'type'        => 'checkbox',
		)
	);
	
	/*Pagination Enable Option*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_enable_pagination',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_enable_pagination',
		array(
			'label'       => __('Enable Pagination', 'massage-wellness-retreat'),
			'description' => __('Checked to show Pagination', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_additional_section',
			'type'        => 'checkbox',
		)
	);

	/*Pagination Select Type Option*/
	$wp_customize->add_setting('massage_wellness_retreat_pagination_type',array(
        'default' => 'type-1',
        'sanitize_callback' => 'massage_wellness_retreat_sanitize_choices'
	));
	$wp_customize->add_control('massage_wellness_retreat_pagination_type',array(
        'type' => 'select',
        'label' => esc_html__('Select Pagination Type','massage-wellness-retreat'),
        'section' => 'massage_wellness_retreat_additional_section',
        'choices' => array(
            'type-1' => esc_html__('Type 1','massage-wellness-retreat'),
            'type-2' => esc_html__('Type 2','massage-wellness-retreat'),
        ),
	) );

	/*Post layout*/
	$wp_customize->add_setting('massage_wellness_retreat_archive_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'massage_wellness_retreat_sanitize_choices'
	));
	$wp_customize->add_control('massage_wellness_retreat_archive_layout',array(
        'type' => 'select',
        'label' => esc_html__('Posts Layout','massage-wellness-retreat'),
        'section' => 'massage_wellness_retreat_additional_section',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','massage-wellness-retreat'),
            'layout-2' => esc_html__('Sidebar On Left','massage-wellness-retreat'),
			'layout-3' => esc_html__('Full Width Layout','massage-wellness-retreat')
        ),
	) );

	/*single post layout*/
	$wp_customize->add_setting('massage_wellness_retreat_post_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'massage_wellness_retreat_sanitize_choices'
	));
	$wp_customize->add_control('massage_wellness_retreat_post_layout',array(
        'type' => 'select',
        'label' => esc_html__('Single Post Layout','massage-wellness-retreat'),
        'section' => 'massage_wellness_retreat_additional_section',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','massage-wellness-retreat'),
            'layout-2' => esc_html__('Sidebar On Left','massage-wellness-retreat'),
			'layout-3' => esc_html__('Full Width Layout','massage-wellness-retreat')
        ),
	) );

	/*single page layout*/
	$wp_customize->add_setting('massage_wellness_retreat_page_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'massage_wellness_retreat_sanitize_choices'
	));
	$wp_customize->add_control('massage_wellness_retreat_page_layout',array(
        'type' => 'select',
        'label' => esc_html__('Single Page Layout','massage-wellness-retreat'),
        'section' => 'massage_wellness_retreat_additional_section',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','massage-wellness-retreat'),
            'layout-2' => esc_html__('Sidebar On Left','massage-wellness-retreat'),
			'layout-3' => esc_html__('Full Width Layout','massage-wellness-retreat')
        ),
	) );

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

	$wp_customize->add_control(
		'massage_wellness_retreat_additional_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more additional options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(MASSAGE_WELLNESS_RETREAT_BUY_NOW) ." '>Check PRO version.</a>
					</div>
				</div>
			",
			'section' => 'massage_wellness_retreat_additional_section'
		)
	);

	/*Archive Post Options*/
	$wp_customize->add_section('massage_wellness_retreat_blog_post_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Blog Page Options', 'massage-wellness-retreat'),
		'panel'       => 'massage_wellness_retreat_panel',
	));

	$wp_customize->add_setting('massage_wellness_retreat_enable_blog_post_title',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
	));
	$wp_customize->add_control('massage_wellness_retreat_enable_blog_post_title',array(
		'label'       => __('Enable Blog Post Title', 'massage-wellness-retreat'),
		'description' => __('Checked To Show Blog Post Title', 'massage-wellness-retreat'),
		'section'     => 'massage_wellness_retreat_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('massage_wellness_retreat_enable_blog_post_meta',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
	));
	$wp_customize->add_control('massage_wellness_retreat_enable_blog_post_meta',array(
		'label'       => __('Enable Blog Post Meta', 'massage-wellness-retreat'),
		'description' => __('Checked To Show Blog Post Meta Feilds', 'massage-wellness-retreat'),
		'section'     => 'massage_wellness_retreat_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('massage_wellness_retreat_enable_blog_post_tags',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
	));
	$wp_customize->add_control('massage_wellness_retreat_enable_blog_post_tags',array(
		'label'       => __('Enable Blog Post Tags', 'massage-wellness-retreat'),
		'description' => __('Checked To Show Blog Post Tags', 'massage-wellness-retreat'),
		'section'     => 'massage_wellness_retreat_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('massage_wellness_retreat_enable_blog_post_image',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
	));
	$wp_customize->add_control('massage_wellness_retreat_enable_blog_post_image',array(
		'label'       => __('Enable Blog Post Image', 'massage-wellness-retreat'),
		'description' => __('Checked To Show Blog Post Image', 'massage-wellness-retreat'),
		'section'     => 'massage_wellness_retreat_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('massage_wellness_retreat_enable_blog_post_content',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
	));
	$wp_customize->add_control('massage_wellness_retreat_enable_blog_post_content',array(
		'label'       => __('Enable Blog Post Content', 'massage-wellness-retreat'),
		'description' => __('Checked To Show Blog Post Content', 'massage-wellness-retreat'),
		'section'     => 'massage_wellness_retreat_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('massage_wellness_retreat_enable_blog_post_button',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
	));
	$wp_customize->add_control('massage_wellness_retreat_enable_blog_post_button',array(
		'label'       => __('Enable Blog Post Read More Button', 'massage-wellness-retreat'),
		'description' => __('Checked To Show Blog Post Read More Button', 'massage-wellness-retreat'),
		'section'     => 'massage_wellness_retreat_blog_post_section',
		'type'        => 'checkbox',
	));

	/*Blog post Content layout*/
	$wp_customize->add_setting('massage_wellness_retreat_blog_Post_content_layout',array(
        'default' => 'Left',
        'sanitize_callback' => 'massage_wellness_retreat_sanitize_choices'
	));
	$wp_customize->add_control('massage_wellness_retreat_blog_Post_content_layout',array(
        'type' => 'select',
        'label' => esc_html__('Blog Post Content Layout','massage-wellness-retreat'),
        'section' => 'massage_wellness_retreat_blog_post_section',
        'choices' => array(
            'Left' => esc_html__('Left','massage-wellness-retreat'),
            'Center' => esc_html__('Center','massage-wellness-retreat'),
            'Right' => esc_html__('Right','massage-wellness-retreat')
        ),
	) );

	/*Excerpt*/
    $wp_customize->add_setting(
		'massage_wellness_retreat_excerpt_limit',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '25',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_excerpt_limit',
		array(
			'label'       => __('Excerpt Limit', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_blog_post_section',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 2,
	             'max' => 50,
	             'step' => 2,
	         ),
		)
	);

	/*Archive Button Text*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_read_more_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'Continue Reading....',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_read_more_text',
		array(
			'label'       => __('Edit Button Text ', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_blog_post_section',
			'type'        => 'text',
		)
	);

	/*Single Post Options*/
	$wp_customize->add_section('massage_wellness_retreat_single_post_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Single Post Options', 'massage-wellness-retreat'),
		'panel'       => 'massage_wellness_retreat_panel',
	));

	$wp_customize->add_setting('massage_wellness_retreat_enable_single_blog_post_title',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
	));
	$wp_customize->add_control('massage_wellness_retreat_enable_single_blog_post_title',array(
		'label'       => __('Enable Single Post Title', 'massage-wellness-retreat'),
		'description' => __('Checked To Show Single Blog Post Title', 'massage-wellness-retreat'),
		'section'     => 'massage_wellness_retreat_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('massage_wellness_retreat_enable_single_blog_post_meta',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
	));
	$wp_customize->add_control('massage_wellness_retreat_enable_single_blog_post_meta',array(
		'label'       => __('Enable Single Post Meta', 'massage-wellness-retreat'),
		'description' => __('Checked To Show Single Blog Post Meta Feilds', 'massage-wellness-retreat'),
		'section'     => 'massage_wellness_retreat_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('massage_wellness_retreat_enable_single_blog_post_tags',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
	));
	$wp_customize->add_control('massage_wellness_retreat_enable_single_blog_post_tags',array(
		'label'       => __('Enable Single Post Tags', 'massage-wellness-retreat'),
		'description' => __('Checked To Show Single Blog Post Tags', 'massage-wellness-retreat'),
		'section'     => 'massage_wellness_retreat_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('massage_wellness_retreat_enable_single_post_image',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
	));
	$wp_customize->add_control('massage_wellness_retreat_enable_single_post_image',array(
		'label'       => __('Enable Single Post Image', 'massage-wellness-retreat'),
		'description' => __('Checked To Show Single Post Image', 'massage-wellness-retreat'),
		'section'     => 'massage_wellness_retreat_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('massage_wellness_retreat_enable_single_blog_post_content',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
	));
	$wp_customize->add_control('massage_wellness_retreat_enable_single_blog_post_content',array(
		'label'       => __('Enable Single Post Content', 'massage-wellness-retreat'),
		'description' => __('Checked To Show Single Blog Post Content', 'massage-wellness-retreat'),
		'section'     => 'massage_wellness_retreat_single_post_section',
		'type'        => 'checkbox',
	));

	/*Related Post Enable Option*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_enable_related_post',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_enable_related_post',
		array(
			'label'       => __('Enable Related Post', 'massage-wellness-retreat'),
			'description' => __('Checked to show Related Post', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_single_post_section',
			'type'        => 'checkbox',
		)
	);

	/*Related post Edit Text*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_related_post_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'Related Post',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_related_post_text',
		array(
			'label'       => __('Edit Related Post Text ', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_single_post_section',
			'type'        => 'text',
		)
	);	

	/*Related Post Per Page*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_related_post_count',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '3',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_related_post_count',
		array(
			'label'       => __('Related Post Count', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_single_post_section',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 9,
	             'step' => 1,
	         ),
		)
	);

	/* Comment Section Enable Option*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_enable_comment_section',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_enable_comment_section',
		array(
			'label'       => __('Enable Comment Section', 'massage-wellness-retreat'),
			'description' => __('Checked to show Comment Section', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_single_post_section',
			'type'        => 'checkbox',
		)
	);

		/*
	* Customizer Global COlor
	*/

	/*Global Color Options*/
	$wp_customize->add_section('massage_wellness_retreat_global_color_section', array(
		'priority'       => 1,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Global Color Options', 'massage-wellness-retreat'),
		'panel'       => 'massage_wellness_retreat_panel',
	));

	$wp_customize->add_setting( 'massage_wellness_retreat_primary_color',
		array(
		'default'           => '#446960',
		'capability'        => 'edit_theme_options',
		'sanitize_callback' => 'sanitize_hex_color',
		)
	);
	$wp_customize->add_control( 
		new WP_Customize_Color_Control( 
		$wp_customize, 
		'massage_wellness_retreat_primary_color',
		array(
			'label'      => esc_html__( 'Primary Color', 'massage-wellness-retreat' ),
			'section'    => 'massage_wellness_retreat_global_color_section',
			'settings'   => 'massage_wellness_retreat_primary_color',
		) ) 
	);

	/*Typography Options*/
	$wp_customize->add_section( 'massage_wellness_retreat_typography_section', array(
		'panel'       => 'massage_wellness_retreat_panel',
        'title'    => __( 'Typography Options', 'massage-wellness-retreat' ),
        'priority' => 2,
    ) );

    $wp_customize->add_setting( 'massage_wellness_retreat_font_family', array(
		'default'           => 'default',
		'sanitize_callback' => 'massage_wellness_retreat_sanitize_font_family',
	) );
	
	$wp_customize->add_control( 'massage_wellness_retreat_font_family', array(
		'label'    => __( 'Global Font Family', 'massage-wellness-retreat' ),
		'section'  => 'massage_wellness_retreat_typography_section',
		'type'     => 'select',
		'choices'  => array(
			'default'          => __( 'Default (Theme Font)', 'massage-wellness-retreat' ),
			'bad_script'       => 'Bad Script',
			'roboto'           => 'Roboto',
			'playfair_display' => 'Playfair Display',
			'open_sans'        => 'Open Sans',
			'lobster'          => 'Lobster',
			'merriweather'     => 'Merriweather',
			'oswald'           => 'Oswald',
			'raleway'          => 'Raleway',
			// Add new fonts here
			'poppins'            => 'Poppins',
			'lato'               => 'Lato',
			'source_sans_pro'    => 'Source Sans Pro',
			'quicksand'          => 'Quicksand',
			'nunito'             => 'Nunito',
			'montserrat'         => 'Montserrat',
			'roboto_condensed'   => 'Roboto Condensed',
			'playfair_display_sc'=> 'Playfair Display SC',
			'alegreya'           => 'Alegreya',
			'fira_sans'          => 'Fira Sans',
		),
	) );

	/*
	* Customizer main header section
	*/

	/*Main Header Options*/
	$wp_customize->add_section('massage_wellness_retreat_header_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Main Header Options', 'massage-wellness-retreat'),
		'panel'       => 'massage_wellness_retreat_panel',
	));

	$wp_customize->add_setting('massage_wellness_retreat_top_head_text',array(
		'default'=> 'Relax, rejuvenate, and restore — enjoy exclusive massage deals this week only!',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('massage_wellness_retreat_top_head_text',array(
		'label'	=> __('Add Offer Text','massage-wellness-retreat'),
		'section'=> 'massage_wellness_retreat_header_section',
		'type'=> 'text'
	));

	$wp_customize->add_setting('massage_wellness_retreat_product_section_btn_link1', array(
		'default'=> '#',
		'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('massage_wellness_retreat_product_section_btn_link1', array(
		'label'	=> esc_html__('Add User URL ','massage-wellness-retreat'),
		'section'=> 'massage_wellness_retreat_header_section',
		'type'=> 'url'
	));

	// Add Setting for Menu Text Transform
    $wp_customize->add_setting( 'massage_wellness_retreat_menu_text_transform', array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 'capitalize',
        'sanitize_callback' => 'massage_wellness_retreat_sanitize_choices'
    ) );

    // Add Control for Menu Text Transform
    $wp_customize->add_control( 'massage_wellness_retreat_menu_text_transform', array(
        'label'    => __( 'Menu Text Transform', 'massage-wellness-retreat' ),
        'section'  => 'massage_wellness_retreat_header_section',
        'type'     => 'select',
        'choices'  => array(
            'none'       => __( 'None', 'massage-wellness-retreat' ),
            'capitalize' => __( 'Capitalize', 'massage-wellness-retreat' ),
            'uppercase'  => __( 'Uppercase', 'massage-wellness-retreat' ),
            'lowercase'  => __( 'Lowercase', 'massage-wellness-retreat' ),
        ),
    ) );

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

	$wp_customize->add_control(
		'massage_wellness_retreat_header_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more header options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(MASSAGE_WELLNESS_RETREAT_BUY_NOW) ." '>Check PRO version.</a>
					</div>
				</div>
			",
			'section' => 'massage_wellness_retreat_header_section'
		)
	);

	/*
	* Customizer main slider section
	*/
	/*Main Slider Options*/
	$wp_customize->add_section('massage_wellness_retreat_slider_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Main Slider Options', 'massage-wellness-retreat'),
		'panel'       => 'massage_wellness_retreat_panel',
	));

	/*Main Slider Enable Option*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_show_slider',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 0,
			'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
		)
	);
	$wp_customize->add_control(
		'massage_wellness_retreat_show_slider',
		array(
			'label'       => __('Enable Slider', 'massage-wellness-retreat'),
			'description' => __('Checked to show slider', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_slider_section',
			'type'        => 'checkbox',
		)
	);

	$wp_customize->add_setting('massage_wellness_retreat_slide_number',array(
		'default'	=> '3',
		'sanitize_callback'	=> 'massage_wellness_retreat_sanitize_choices',
	));
	$wp_customize->add_control('massage_wellness_retreat_slide_number',array(
		'label'	=> __('Number of slides to show','massage-wellness-retreat'),
		'description' => __('Add Max 3 number Of slide and refresh page','massage-wellness-retreat'),
		'section'	=> 'massage_wellness_retreat_slider_section',
		'type'		=> 'select',
		'choices'  => array(
			'1' => '1',
			'2' => '2',
			'3' => '3',
		),
	));

	$massage_wellness_retreat_count =  get_theme_mod('massage_wellness_retreat_slide_number', '3');

	for($massage_wellness_retreat_i=1; $massage_wellness_retreat_i<=$massage_wellness_retreat_count; $massage_wellness_retreat_i++) {		

		$wp_customize->add_setting('massage_wellness_retreat_banner_background_image_sec'.$massage_wellness_retreat_i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'esc_url_raw',
		));
		$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'massage_wellness_retreat_banner_background_image_sec'.$massage_wellness_retreat_i,array(
	      'label' => __('Slider Background Image','massage-wellness-retreat'),
			'description' => __('Image Size (1200px x 600px)','massage-wellness-retreat'),
	      'section' => 'massage_wellness_retreat_slider_section'
		)));

		$wp_customize->add_setting('massage_wellness_retreat_slider_top_title'.$massage_wellness_retreat_i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'sanitize_text_field'
		));
		$wp_customize->add_control('massage_wellness_retreat_slider_top_title'.$massage_wellness_retreat_i,array(
			'label'	=> __('Slider Top Title','massage-wellness-retreat'),
			'type'	=> 'text',
			'section'	=> 'massage_wellness_retreat_slider_section',
		));

	 	$wp_customize->add_setting('massage_wellness_retreat_slider_title'.$massage_wellness_retreat_i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'sanitize_text_field'
		));
		$wp_customize->add_control('massage_wellness_retreat_slider_title'.$massage_wellness_retreat_i,array(
			'label'	=> __('Slider Heading','massage-wellness-retreat'),
			'type'	=> 'text',
			'section'	=> 'massage_wellness_retreat_slider_section',
		));

	 	$wp_customize->add_setting('massage_wellness_retreat_slider_text'.$massage_wellness_retreat_i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'sanitize_text_field'
		));
		$wp_customize->add_control('massage_wellness_retreat_slider_text'.$massage_wellness_retreat_i,array(
			'label'	=> __('Slider Content','massage-wellness-retreat'),
			'type'		=> 'text',
			'section'	=> 'massage_wellness_retreat_slider_section',
		));
		
		/*Main Slider Button1 Text*/
		$wp_customize->add_setting(
			'massage_wellness_retreat_slider_button1_text'.$massage_wellness_retreat_i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'sanitize_text_field',
			)
		);

		$wp_customize->add_control(
			'massage_wellness_retreat_slider_button1_text'.$massage_wellness_retreat_i,
			array(
				'label'       => __('Edit Button #1 Text ', 'massage-wellness-retreat') .$massage_wellness_retreat_i,
				'description' => __('Edit the slider button text.', 'massage-wellness-retreat'),
				'section'     => 'massage_wellness_retreat_slider_section',
				'type'        => 'text',
			)
		);

		/*Main Slider Button1 URL*/
		$wp_customize->add_setting(
			'massage_wellness_retreat_slider_button1_link'.$massage_wellness_retreat_i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'esc_url_raw',
			)
		);

		$wp_customize->add_control(
			'massage_wellness_retreat_slider_button1_link'.$massage_wellness_retreat_i,
			array(
				'label'       => __('Edit Button #1 URL ', 'massage-wellness-retreat') .$massage_wellness_retreat_i,
				'description' => __('Edit the slider button url.', 'massage-wellness-retreat'),
				'section'     => 'massage_wellness_retreat_slider_section',
				'type'        => 'url',
			)
		);
	}

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

	$wp_customize->add_control(
		'massage_wellness_retreat_slider_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more slider options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(MASSAGE_WELLNESS_RETREAT_BUY_NOW) ." '>Check PRO version.</a>
					</div>
				</div>
			",
			'section' => 'massage_wellness_retreat_slider_section'
		)
	);

	/*
	* Customizer Blog section
	*/
	/*Blog Options*/
	$wp_customize->add_section('massage_wellness_retreat_events_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Our Services Options', 'massage-wellness-retreat'),
		'panel'       => 'massage_wellness_retreat_panel',
	));

	/*Blog Enable Option*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_enable_event',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 0,
			'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_enable_event',
		array(
			'label'       => __('Enable Our Services Section', 'massage-wellness-retreat'),
			'description' => __('Checked to show the category', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_events_section',
			'type'        => 'checkbox',
		)
	);

	/*Blog Heading*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_event_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_event_text',
		array(
			'label'       => __('Edit Section Heading', 'massage-wellness-retreat'),
			'description' => __('Edit section heading', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_events_section',
			'type'        => 'text',
		)
	);

	/*Blog Text*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_event_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_event_text',
		array(
			'label'       => __('Edit Section Text', 'massage-wellness-retreat'),
			'description' => __('Edit Our Services section text', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_events_section',
			'type'        => 'text',
		)
	);


	$massage_wellness_retreat_categories = get_categories();
	$massage_wellness_retreat_cats = array();
	$massage_wellness_retreat_i = 0;
	$massage_wellness_retreat_cat_pst1[]= 'select';
	foreach($massage_wellness_retreat_categories as $massage_wellness_retreat_category){
		if($massage_wellness_retreat_i==0){
			$massage_wellness_retreat_default = $massage_wellness_retreat_category->slug;
			$massage_wellness_retreat_i++;
		}
		$massage_wellness_retreat_cat_pst1[$massage_wellness_retreat_category->slug] = $massage_wellness_retreat_category->name;
	}

	$wp_customize->add_setting(
		'massage_wellness_retreat_blog_cat',
		array(
		    'default' => 'uncategorized',
		    'sanitize_callback' => 'massage_wellness_retreat_sanitize_choices',
  		)
  	);

  	$wp_customize->add_control(
  		'massage_wellness_retreat_blog_cat',
  		array(
		    'type'    => 'select',
		    'choices' => $massage_wellness_retreat_cat_pst1,
		    'label' => __('Select Category to display Our Services','massage-wellness-retreat'),
		    'section' => 'massage_wellness_retreat_events_section',
		)
	);

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

	$wp_customize->add_control(
		'massage_wellness_retreat_services_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more services options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(MASSAGE_WELLNESS_RETREAT_BUY_NOW) ." '>Check PRO version.</a>
					</div>
				</div>
			",
			'section' => 'massage_wellness_retreat_events_section'
		)
	);

	/*
	* Customizer Footer Section
	*/
	/*Footer Options*/
	$wp_customize->add_section('massage_wellness_retreat_footer_section', array(
		'priority'       => 6,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Footer Options', 'massage-wellness-retreat'),
		'panel'       => 'massage_wellness_retreat_panel',
	));

	/*Footer Enable Option*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_enable_footer',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
		)
	);
	$wp_customize->add_control(
		'massage_wellness_retreat_enable_footer',
		array(
			'label'       => __('Enable Footer', 'massage-wellness-retreat'),
			'description' => __('Checked to show Footer', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_footer_section',
			'type'        => 'checkbox',
		)
	);

	/*Footer bg image Option*/
	$wp_customize->add_setting('massage_wellness_retreat_footer_bg_image',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
        'default'           => '',
        'sanitize_callback' => 'esc_url_raw',
    ));
    $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'massage_wellness_retreat_footer_bg_image',array(
        'label' => __('Footer Background Image','massage-wellness-retreat'),
        'section' => 'massage_wellness_retreat_footer_section',
    )));

	/** Footer bg Image Attachment */
    $wp_customize->add_setting('massage_wellness_retreat_background_attachment', array(
        'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 'scroll',
        'sanitize_callback' => 'massage_wellness_retreat_sanitize_choices'
    ));

    $wp_customize->add_control('massage_wellness_retreat_background_attachment', array(
        'label'    => __('Footer Background Attachment', 'massage-wellness-retreat'),
        'section'  => 'massage_wellness_retreat_footer_section',
        'settings' => 'massage_wellness_retreat_background_attachment',
        'type'     => 'select',
        'choices'  => array(
            'fixed' => __('fixed','massage-wellness-retreat'),
            'scroll' => __('scroll','massage-wellness-retreat'),
        ),
    ));

	/*Footer Social Menu Option*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_footer_social_menu',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_footer_social_menu',
		array(
			'label'       => __('Enable Footer Social Menu', 'massage-wellness-retreat'),
			'description' => __('Checked to show the footer social menu. Go to Dashboard >> Appearance >> Menus >> Create New Menu >> Add Custom Link >> Add Social Menu >> Checked Social Menu >> Save Menu.', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_footer_section',
			'type'        => 'checkbox',
		)
	);	

	/*Go To Top Option*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_enable_go_to_top_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'massage_wellness_retreat_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_enable_go_to_top_option',
		array(
			'label'       => __('Enable Go To Top', 'massage-wellness-retreat'),
			'description' => __('Checked to enable Go To Top option.', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_footer_section',
			'type'        => 'checkbox',
		)
	);

	$wp_customize->add_setting('massage_wellness_retreat_go_to_top_position',array(
        'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 'Right',
        'sanitize_callback' => 'massage_wellness_retreat_sanitize_choices'
    ));
    $wp_customize->add_control('massage_wellness_retreat_go_to_top_position',array(
        'type' => 'select',
        'section' => 'massage_wellness_retreat_footer_section',
        'label' => esc_html__('Go To Top Positions','massage-wellness-retreat'),
        'choices' => array(
            'Right' => __('Right','massage-wellness-retreat'),
            'Left' => __('Left','massage-wellness-retreat'),
            'Center' => __('Center','massage-wellness-retreat')
        ),
    ) );

	/*Footer Copyright Text Enable*/
	$wp_customize->add_setting(
		'massage_wellness_retreat_copyright_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'massage_wellness_retreat_copyright_option',
		array(
			'label'       => __('Edit Copyright Text', 'massage-wellness-retreat'),
			'description' => __('Edit the Footer Copyright Section.', 'massage-wellness-retreat'),
			'section'     => 'massage_wellness_retreat_footer_section',
			'type'        => 'text',
		)
	);

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

	$wp_customize->add_control(
		'massage_wellness_retreat_footer_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more footer options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(MASSAGE_WELLNESS_RETREAT_BUY_NOW) ." '>Check PRO version.</a>
					</div>
				</div>
			",
			'section' => 'massage_wellness_retreat_footer_section'
		)
	);

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

/**
 * Render the site title for the selective refresh partial.
 *
 * @return void
 */
function Massage_Wellness_Retreat_Customize_partial_blogname() {
	bloginfo( 'name' );
}

/**
 * Render the site tagline for the selective refresh partial.
 *
 * @return void
 */
function Massage_Wellness_Retreat_Customize_partial_blogdescription() {
	bloginfo( 'description' );
}

/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 */
function Massage_Wellness_Retreat_Customize_preview_js() {
	wp_enqueue_script( 'massage-wellness-retreat-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), MASSAGE_WELLNESS_RETREAT_VERSION, true );
}
add_action( 'customize_preview_init', 'Massage_Wellness_Retreat_Customize_preview_js' );

/**
 * Singleton class for handling the theme's customizer integration.
 *
 * @since  1.0.0
 * @access public
 */
final class Massage_Wellness_Retreat_Customize {

	/**
	 * Returns the instance.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return object
	 */
	public static function get_instance() {

		static $massage_wellness_retreat_instance = null;

		if ( is_null( $massage_wellness_retreat_instance ) ) {
			$massage_wellness_retreat_instance = new self;
			$massage_wellness_retreat_instance->setup_actions();
		}

		return $massage_wellness_retreat_instance;
	}

	/**
	 * Constructor method.
	 *
	 * @since  1.0.0
	 * @access private
	 * @return void
	 */
	private function __construct() {}

	/**
	 * Sets up initial actions.
	 *
	 * @since  1.0.0
	 * @access private
	 * @return void
	 */
	private function setup_actions() {

		// Register panels, sections, settings, controls, and partials.
		add_action( 'customize_register', array( $this, 'sections' ) );

		// Register scripts and styles for the controls.
		add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ), 0 );
	}

	/**
	 * Sets up the customizer sections.
	 *
	 * @since  1.0.0
	 * @access public
	 * @param  object  $massage_wellness_retreat_manager
	 * @return void
	*/
	public function sections( $massage_wellness_retreat_manager ) {
		// Load custom sections.
		load_template( trailingslashit( get_template_directory() ) . '/revolution/inc/section-pro.php' );

		// Register custom section types.
		$massage_wellness_retreat_manager->register_section_type( 'Massage_Wellness_Retreat_Customize_Section_Pro' );

		// Register sections.
		$massage_wellness_retreat_manager->add_section( new Massage_Wellness_Retreat_Customize_Section_Pro( $massage_wellness_retreat_manager,'massage_wellness_retreat_go_pro', array(
			'priority'   => 1,
			'title'    => MASSAGE_WELLNESS_RETREAT_PRO_NAME,
			'pro_text' => esc_html__( 'Buy Pro', 'massage-wellness-retreat' ),
			'pro_url'    => esc_url( MASSAGE_WELLNESS_RETREAT_BUY_NOW ),
		) )	);

		// Register sections.
		$massage_wellness_retreat_manager->add_section( new Massage_Wellness_Retreat_Customize_Section_Pro( $massage_wellness_retreat_manager,'massage_wellness_retreat_lite_documentation', array(
			'priority'   => 1,
			'title'    => esc_html__( 'Lite Documentation', 'massage-wellness-retreat' ),
			'pro_text' => esc_html__( 'Instruction', 'massage-wellness-retreat' ),
			'pro_url'    => esc_url( MASSAGE_WELLNESS_RETREAT_LITE_DOC ),
		) )	);

		$massage_wellness_retreat_manager->add_section( new Massage_Wellness_Retreat_Customize_Section_Pro( $massage_wellness_retreat_manager, 'massage_wellness_retreat_live_demo', array(
		    'priority'   => 1,
		    'title'      => esc_html__( 'Pro Theme Demo', 'massage-wellness-retreat' ),
		    'pro_text'   => esc_html__( 'Live Preview', 'massage-wellness-retreat' ),
		    'pro_url'    => esc_url( MASSAGE_WELLNESS_RETREAT_LIVE_DEMO ),
		) ) );

	}

	/**
	 * Loads theme customizer CSS.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return void
	 */
	public function enqueue_control_scripts() {

		wp_enqueue_script( 'massage-wellness-retreat-customize-controls', trailingslashit( get_template_directory_uri() ) . '/revolution/assets/js/customize-controls.js', array( 'customize-controls' ) );

		wp_enqueue_style( 'massage-wellness-retreat-customize-controls', trailingslashit( get_template_directory_uri() ) . '/revolution/assets/css/customize-controls.css' );
	}
}

// Doing this customizer thang!
Massage_Wellness_Retreat_Customize::get_instance();