<?php
/**
 * meditation-and-yoga: Customizer
 *
 * @subpackage meditation-and-yoga
 * @since 1.0
 */

function meditation_and_yoga_customize_register( $wp_customize ) {

	$wp_customize->add_setting('meditation_and_yoga_logo_size',array(
		'sanitize_callback'	=> 'meditation_and_yoga_sanitize_float'
	));
	$wp_customize->add_control('meditation_and_yoga_logo_size',array(
		'type' => 'range',
		'label' => __('Logo Size','meditation-and-yoga'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('meditation_and_yoga_logo_padding',array(
		'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('meditation_and_yoga_logo_padding',array(
		'label' => __('Logo Padding','meditation-and-yoga'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('meditation_and_yoga_logo_top_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'meditation_and_yoga_sanitize_float'
	));
	$wp_customize->add_control('meditation_and_yoga_logo_top_padding',array(
		'type' => 'number',
		'description' => __('Top','meditation-and-yoga'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('meditation_and_yoga_logo_bottom_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'meditation_and_yoga_sanitize_float'
	));
	$wp_customize->add_control('meditation_and_yoga_logo_bottom_padding',array(
		'type' => 'number',
		'description' => __('Bottom','meditation-and-yoga'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('meditation_and_yoga_logo_left_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'meditation_and_yoga_sanitize_float'
	));
	$wp_customize->add_control('meditation_and_yoga_logo_left_padding',array(
		'type' => 'number',
		'description' => __('Left','meditation-and-yoga'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('meditation_and_yoga_logo_right_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'meditation_and_yoga_sanitize_float'
	));
	$wp_customize->add_control('meditation_and_yoga_logo_right_padding',array(
		'type' => 'number',
		'description' => __('Right','meditation-and-yoga'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('meditation_and_yoga_show_site_title',array(
      'default' => true,
      'sanitize_callback'	=> 'meditation_and_yoga_sanitize_checkbox'
   ));
   $wp_customize->add_control('meditation_and_yoga_show_site_title',array(
      'type' => 'checkbox',
      'label' => __('Show / Hide Site Title','meditation-and-yoga'),
      'section' => 'title_tagline'
   ));

	$wp_customize->add_setting('meditation_and_yoga_site_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'meditation_and_yoga_sanitize_float'
	));
	$wp_customize->add_control('meditation_and_yoga_site_title_font_size',array(
		'type' => 'number',
		'label' => __('Site Title Font Size','meditation-and-yoga'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting( 'meditation_and_yoga_site_title_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_site_title_color', array(
		'label' => 'Title Color',
		'section' => 'title_tagline',
	)));

   $wp_customize->add_setting('meditation_and_yoga_show_tagline',array(
      'default' => true,
      'sanitize_callback'	=> 'meditation_and_yoga_sanitize_checkbox'
   ));
   $wp_customize->add_control('meditation_and_yoga_show_tagline',array(
      'type' => 'checkbox',
      'label' => __('Show / Hide Site Tagline','meditation-and-yoga'),
      'section' => 'title_tagline'
   ));

	$wp_customize->add_setting('meditation_and_yoga_site_tagline_font_size',array(
		'default' => '',
		'sanitize_callback' => 'meditation_and_yoga_sanitize_float'
	));
	$wp_customize->add_control('meditation_and_yoga_site_tagline_font_size',array(
		'type' => 'number',
		'label' => __('Site Tagline Font Size','meditation-and-yoga'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting( 'meditation_and_yoga_site_tagline_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_site_tagline_color', array(
		'label' => 'Tagline Color',
		'section' => 'title_tagline',
	)));

	$wp_customize->add_panel( 'meditation_and_yoga_panel_id', array(
	   'priority' => 10,
	   'capability' => 'edit_theme_options',
	   'theme_supports' => '',
	   'title' => __( 'Theme Settings', 'meditation-and-yoga' ),
	   'description' => __( 'Description of what this panel does.', 'meditation-and-yoga' ),
	) );

	$wp_customize->add_section( 'meditation_and_yoga_theme_options_section', array(
    	'title'      => __( 'General Settings', 'meditation-and-yoga' ),
		'priority'   => 30,
		'panel' => 'meditation_and_yoga_panel_id'
	) );

	// Add Settings and Controls for Layout
	$wp_customize->add_setting('meditation_and_yoga_theme_options',array(
        'default' => 'Right Sidebar',
        'sanitize_callback' => 'meditation_and_yoga_sanitize_choices'	        
	));
	$wp_customize->add_control('meditation_and_yoga_theme_options',array(
        'type' => 'radio',
        'label' => __('Do you want this section','meditation-and-yoga'),
        'section' => 'meditation_and_yoga_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','meditation-and-yoga'),
            'Right Sidebar' => __('Right Sidebar','meditation-and-yoga'),
            'One Column' => __('One Column','meditation-and-yoga'),
            'Three Columns' => __('Three Columns','meditation-and-yoga'),
            'Four Columns' => __('Four Columns','meditation-and-yoga'),
            'Grid Layout' => __('Grid Layout','meditation-and-yoga')
        ),
	));

	$wp_customize->add_setting( 'meditation_and_yoga_boxfull_width', array(
		'default'           => '',
		'sanitize_callback' => 'meditation_and_yoga_sanitize_choices'
	));
	
	$wp_customize->add_control( 'meditation_and_yoga_boxfull_width', array(
		'label'    => __( 'Section Width', 'meditation-and-yoga' ),
		'section'  => 'meditation_and_yoga_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'container'  => __('Box Width', 'meditation-and-yoga'),
			'container-fluid' => __('Full Width', 'meditation-and-yoga'),
			'none' => __('None', 'meditation-and-yoga')
		),
	));

	$wp_customize->add_setting( 'meditation_and_yoga_dropdown_anim', array(
		'default'           => 'None',
		'sanitize_callback' => 'meditation_and_yoga_sanitize_choices'
	));
	$wp_customize->add_control( 'meditation_and_yoga_dropdown_anim', array(
		'label'    => __( 'Menu Dropdown Animations', 'meditation-and-yoga' ),
		'section'  => 'meditation_and_yoga_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInUp'  => __('bounceInUp', 'meditation-and-yoga'),
			'fadeInUp' => __('fadeInUp', 'meditation-and-yoga'),
			'zoomIn'    => __('zoomIn', 'meditation-and-yoga'),
			'None'    => __('None', 'meditation-and-yoga')
		),
	));

	// Top Bar
	$wp_customize->add_section( 'meditation_and_yoga_contact_details', array(
    	'title'      => __( 'Top Bar', 'meditation-and-yoga' ),
		'priority'   => null,
		'panel' => 'meditation_and_yoga_panel_id'
	) );

	$wp_customize->add_setting('meditation_and_yoga_mail1',array(
		'default'=> '',
		'sanitize_callback'	=> 'sanitize_email'
	));	
	$wp_customize->add_control('meditation_and_yoga_mail1',array(
		'label'	=> __('Email Address','meditation-and-yoga'),
		'section'=> 'meditation_and_yoga_contact_details',
		'setting'=> 'meditation_and_yoga_mail1',
		'type'=> 'text'
	));		
	
	$wp_customize->add_setting('meditation_and_yoga_call1',array(
		'default'=> '',
		'sanitize_callback'	=> 'meditation_and_yoga_sanitize_phone_number'
	));	
	$wp_customize->add_control('meditation_and_yoga_call1',array(
		'label'	=> __('Phone Number','meditation-and-yoga'),
		'section'=> 'meditation_and_yoga_contact_details',
		'setting'=> 'meditation_and_yoga_call1',
		'type'=> 'text'
	));
	
	$wp_customize->add_setting( 'meditation_and_yoga_toptext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_toptext_color', array(
		'label' => 'Text Color',
		'section' => 'meditation_and_yoga_contact_details',
	)));

	$wp_customize->add_setting( 'meditation_and_yoga_topicon_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_topicon_color', array(
		'label' => 'Icon Color',
		'section' => 'meditation_and_yoga_contact_details',
	)));

	$wp_customize->add_setting( 'meditation_and_yoga_topbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_topbg_color', array(
		'label' => 'Background Color',
		'section' => 'meditation_and_yoga_contact_details',
	)));

	$wp_customize->add_setting( 'meditation_and_yoga_searchtext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_searchtext_color', array(
		'label' => 'Search Field Text Color',
		'section' => 'meditation_and_yoga_contact_details',
	)));
	
	//home page slider
	$wp_customize->add_section( 'meditation_and_yoga_slider_section' , array(
    	'title'      => __( 'Slider Settings', 'meditation-and-yoga' ),
		'priority'   => null,
		'panel' => 'meditation_and_yoga_panel_id'
	) );

	$wp_customize->add_setting('meditation_and_yoga_slider_hide_show',array(
    	'default' => false,
    	'sanitize_callback'	=> 'meditation_and_yoga_sanitize_checkbox'
	));
	$wp_customize->add_control('meditation_and_yoga_slider_hide_show',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide slider','meditation-and-yoga'),
   	'description' => __('Image Size ( 1600px x 582px )','meditation-and-yoga'),
   	'section' => 'meditation_and_yoga_slider_section',
	));

	$wp_customize->add_setting( 'meditation_and_yoga_slider_effect', array(
		'default'           => '',
		'sanitize_callback' => 'meditation_and_yoga_sanitize_choices'
	));
	$wp_customize->add_control( 'meditation_and_yoga_slider_effect', array(
		'label'    => __( 'Onload Transactions Effects', 'meditation-and-yoga' ),
		'section'  => 'meditation_and_yoga_slider_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInLeft'  => __('bounceInLeft', 'meditation-and-yoga'),
			'bounceInRight' => __('bounceInRight', 'meditation-and-yoga'),
			'bounceInUp'    => __('bounceInUp', 'meditation-and-yoga'),
			'bounceInDown'    => __('bounceInDown', 'meditation-and-yoga'),
			'zoomIn'  => __('zoomIn', 'meditation-and-yoga'),
			'zoomOut' => __('zoomOut', 'meditation-and-yoga'),
			'fadeInDown'    => __('fadeInDown', 'meditation-and-yoga'),
			'fadeInUp'    => __('fadeInUp', 'meditation-and-yoga'),
			'fadeInLeft'  => __('fadeInLeft', 'meditation-and-yoga'),
			'fadeInRight' => __('fadeInRight', 'meditation-and-yoga'),
			'flip-up'    => __('flip-up', 'meditation-and-yoga'),
			'none'    => __('none', 'meditation-and-yoga')
		),
	));

	for ( $count = 1; $count <= 4; $count++ ) {
		$wp_customize->add_setting( 'meditation_and_yoga_slider' . $count, array(
			'default'           => '',
			'sanitize_callback' => 'meditation_and_yoga_sanitize_dropdown_pages'
		) );
		$wp_customize->add_control( 'meditation_and_yoga_slider' . $count, array(
			'label'    => __( 'Select Slide Image Page', 'meditation-and-yoga' ),
			'section'  => 'meditation_and_yoga_slider_section',
			'type'     => 'dropdown-pages'
		) );
	}

	$wp_customize->add_setting('meditation_and_yoga_slider_excerpt_length',array(
		'default' => '15',
		'sanitize_callback'	=> 'meditation_and_yoga_sanitize_float'
	));
	$wp_customize->add_control('meditation_and_yoga_slider_excerpt_length',array(
		'type' => 'number',
		'label' => __('Slider Excerpt Length','meditation-and-yoga'),
		'section' => 'meditation_and_yoga_slider_section',
	));

	$wp_customize->add_setting('meditation_and_yoga_slider_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'meditation_and_yoga_sanitize_float'
	));
	$wp_customize->add_control('meditation_and_yoga_slider_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','meditation-and-yoga'),
		'section' => 'meditation_and_yoga_slider_section',
	));

	$wp_customize->add_setting('meditation_and_yoga_slider_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'meditation_and_yoga_sanitize_float'
	));
	$wp_customize->add_control('meditation_and_yoga_slider_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','meditation-and-yoga'),
		'section' => 'meditation_and_yoga_slider_section',
	));

	$wp_customize->add_setting( 'meditation_and_yoga_slider_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_slider_color', array(
		'label' => 'Text Color',
		'section' => 'meditation_and_yoga_slider_section',
	)));

	$wp_customize->add_setting( 'meditation_and_yoga_sliderbtn_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_sliderbtn_color', array(
		'label' => 'Button Text Color',
		'section' => 'meditation_and_yoga_slider_section',
	)));

	$wp_customize->add_setting( 'meditation_and_yoga_sliderbtnbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_sliderbtnbg_color', array(
		'label' => 'Button Bg Color',
		'section' => 'meditation_and_yoga_slider_section',
	)));

	$wp_customize->add_setting( 'meditation_and_yoga_slidernp_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_slidernp_color', array(
		'label' => 'Arrow Color',
		'section' => 'meditation_and_yoga_slider_section',
	)));

	$wp_customize->add_setting( 'meditation_and_yoga_slidernpbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_slidernpbg_color', array(
		'label' => 'Arrow Bg Color',
		'section' => 'meditation_and_yoga_slider_section',
	)));

	//	Our Topics
	$wp_customize->add_section('meditation_and_yoga_service',array(
		'title'	=> __('Our Topics','meditation-and-yoga'),
		'description'=> __('<b>Note : </b>This section will appear below the slider.','meditation-and-yoga'),
		'panel' => 'meditation_and_yoga_panel_id',
	));
	
	$wp_customize->add_setting('meditation_and_yoga_title',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('meditation_and_yoga_title',array(
		'label'	=> __('Section Title','meditation-and-yoga'),
		'section'	=> 'meditation_and_yoga_service',
		'setting'	=> 'meditation_and_yoga_title',
		'type'		=> 'text'
	));

	$categories = get_categories();
	$cats = array();
	$i = 0;
	$cat_pst[]= 'select';
	foreach($categories as $category){
		if($i==0){
			$default = $category->slug;
			$i++;
		}
		$cat_pst[$category->slug] = $category->name;
	}

	$wp_customize->add_setting('meditation_and_yoga_cat',array(
		'default'	=> 'select',
		'sanitize_callback' => 'meditation_and_yoga_sanitize_choices',
	));
	$wp_customize->add_control('meditation_and_yoga_cat',array(
		'type'    => 'select',
		'choices' => $cat_pst,
		'label' => __('Select Category To Display Post','meditation-and-yoga'),
		'section' => 'meditation_and_yoga_service',
	));

	$wp_customize->add_setting('meditation_and_yoga_img_hight',array(
		'default' => '',
		'sanitize_callback'	=> 'meditation_and_yoga_sanitize_float'
	));
	$wp_customize->add_control('meditation_and_yoga_img_hight',array(
		'type' => 'number',
		'label' => __('Image Hight','meditation-and-yoga'),
		'section' => 'meditation_and_yoga_service',
	));

	$wp_customize->add_setting('meditation_and_yoga_topic_section_padding',array(
      'default' => '',
      'sanitize_callback' => 'meditation_and_yoga_sanitize_float'
	));
	$wp_customize->add_control('meditation_and_yoga_topic_section_padding',array(
		'type' => 'number',
		'label' => __('Section Top Bottom Padding','meditation-and-yoga'),
		'section' => 'meditation_and_yoga_service',
	));

	$wp_customize->add_setting( 'meditation_and_yoga_service_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_service_color', array(
		'label' => 'Section Title Color',
		'section' => 'meditation_and_yoga_service',
	)));

	$wp_customize->add_setting( 'meditation_and_yoga_service_title_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_service_title_color', array(
		'label' => 'Title Color',
		'section' => 'meditation_and_yoga_service',
	)));

	$wp_customize->add_setting( 'meditation_and_yoga_service_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_service_text_color', array(
		'label' => 'Text Color',
		'section' => 'meditation_and_yoga_service',
	)));

	$wp_customize->add_setting( 'meditation_and_yoga_service_boxbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_service_boxbg_color', array(
		'label' => 'Box Bg Color',
		'section' => 'meditation_and_yoga_service',
	)));

	//Footer
   $wp_customize->add_section( 'meditation_and_yoga_footer', array(
    	'title'      => __( 'Footer Setting', 'meditation-and-yoga' ),
		'priority'   => null,
		'panel' => 'meditation_and_yoga_panel_id'
	) );

	$wp_customize->add_setting('meditation_and_yoga_show_back_totop',array(
 		'default' => true,
   	'sanitize_callback'	=> 'meditation_and_yoga_sanitize_checkbox'
	));
	$wp_customize->add_control('meditation_and_yoga_show_back_totop',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide Back to Top','meditation-and-yoga'),
   	'section' => 'meditation_and_yoga_footer'
	));

   $wp_customize->add_setting('meditation_and_yoga_footer_link',array(
		'default'	=> 'https://www.luzuk.com/products/free-meditation-yoga-wordpress-theme/',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('meditation_and_yoga_footer_link',array(
		'label'	=> __('Copyright Link','meditation-and-yoga'),
		'section'	=> 'meditation_and_yoga_footer',
		'setting'	=> 'meditation_and_yoga_footer_link',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('meditation_and_yoga_footer_copy',array(
		'default'	=> 'Meditation Yoga WordPress Theme By Luzuk',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('meditation_and_yoga_footer_copy',array(
		'label'	=> __('Copyright Text','meditation-and-yoga'),
		'section'	=> 'meditation_and_yoga_footer',
		'setting'	=> 'meditation_and_yoga_footer_copy',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('meditation_and_yoga_copyright_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'meditation_and_yoga_sanitize_float'
 	));
 	$wp_customize->add_control('meditation_and_yoga_copyright_padding',array(
		'type' => 'number',
		'label' => __('Copyright Top Bottom Padding','meditation-and-yoga'),
		'section' => 'meditation_and_yoga_footer',
	));

	$wp_customize->add_setting( 'meditation_and_yoga_footer_widgets_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_footer_widgets_color', array(
		'label' => 'Widgets Title Color',
		'section' => 'meditation_and_yoga_footer',
	)));

	$wp_customize->add_setting( 'meditation_and_yoga_footer_widgets_menu_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_footer_widgets_menu_color', array(
		'label' => 'Widgets Menus Color',
		'section' => 'meditation_and_yoga_footer',
	)));

	$wp_customize->add_setting( 'meditation_and_yoga_footer_overlay_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'meditation_and_yoga_footer_overlay_color', array(
		'label' => 'Overlay Color',
		'section' => 'meditation_and_yoga_footer',
	)));

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

	$wp_customize->selective_refresh->add_partial( 'blogname', array(
		'selector' => '.site-title a',
		'render_callback' => 'meditation_and_yoga_customize_partial_blogname',
	) );
	$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
		'selector' => '.site-description',
		'render_callback' => 'meditation_and_yoga_customize_partial_blogdescription',
	) );
}
add_action( 'customize_register', 'meditation_and_yoga_customize_register' );

function meditation_and_yoga_customize_partial_blogname() {
	bloginfo( 'name' );
}

function meditation_and_yoga_customize_partial_blogdescription() {
	bloginfo( 'description' );
}

function meditation_and_yoga_is_static_front_page() {
	return ( is_front_page() && ! is_home() );
}

function meditation_and_yoga_is_view_with_layout_option() {
	// This option is available on all pages. It's also available on archives when there isn't a sidebar.
	return ( is_page() || ( is_archive() && ! is_active_sidebar( 'sidebar-1' ) ) );
}

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

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

		static $instance = null;

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

		return $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  $manager
	 * @return void
	 */
	public function sections( $manager ) {

		// Load custom sections.
		load_template( trailingslashit( get_template_directory() ) . '/inc/section-pro.php' );

		// Register custom section types.
		$manager->register_section_type( 'Meditation_And_Yoga_Customize_Section_Pro' );

		// Register sections.
		$manager->add_section(
			new Meditation_And_Yoga_Customize_Section_Pro(
				$manager,
				'meditation_and_yoga_example_1',
				array(
					'priority' => 9,
					'title'    => esc_html__( 'Meditation Pro Theme', 'meditation-and-yoga' ),
					'pro_text' => esc_html__( 'Go Pro','meditation-and-yoga' ),
					'pro_url'  => esc_url( 'https://www.luzuk.com/products/meditation-yoga-wordpress-theme/' ),
				)
			)
		);
	}

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

		wp_enqueue_script( 'meditation-and-yoga-customize-controls', trailingslashit( esc_url(get_template_directory_uri()) ) . '/assets/js/customize-controls.js', array( 'customize-controls' ) );

		wp_enqueue_style( 'meditation-and-yoga-customize-controls', trailingslashit( esc_url(get_template_directory_uri()) ) . '/assets/css/customize-controls.css' );
	}
}

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