<?php
/**
 * play-school-kindergarten: Customizer
 *
 * @subpackage play-school-kindergarten
 * @since 1.0
 */

function play_school_kindergarten_customize_register( $wp_customize ) {

	$wp_customize->add_setting('play_school_kindergarten_logo_size',array(
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_logo_size',array(
		'type' => 'range',
		'label' => __('Logo Size','play-school-kindergarten'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('play_school_kindergarten_logo_padding',array(
		'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('play_school_kindergarten_logo_padding',array(
		'label' => __('Logo Padding','play-school-kindergarten'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('play_school_kindergarten_logo_top_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_logo_top_padding',array(
		'type' => 'number',
		'description' => __('Top','play-school-kindergarten'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('play_school_kindergarten_logo_bottom_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_logo_bottom_padding',array(
		'type' => 'number',
		'description' => __('Bottom','play-school-kindergarten'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('play_school_kindergarten_logo_left_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_logo_left_padding',array(
		'type' => 'number',
		'description' => __('Left','play-school-kindergarten'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('play_school_kindergarten_logo_right_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_logo_right_padding',array(
		'type' => 'number',
		'description' => __('Right','play-school-kindergarten'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('play_school_kindergarten_show_site_title',array(
		'default' => true,
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_checkbox'
	));
	$wp_customize->add_control('play_school_kindergarten_show_site_title',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Title','play-school-kindergarten'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('play_school_kindergarten_site_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_site_title_font_size',array(
		'type' => 'number',
		'label' => __('Site Title Font Size','play-school-kindergarten'),
		'section' => 'title_tagline',
	));

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

	$wp_customize->add_setting('play_school_kindergarten_show_tagline',array(
		'default' => true,
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_checkbox'
	));
	$wp_customize->add_control('play_school_kindergarten_show_tagline',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Tagline','play-school-kindergarten'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('play_school_kindergarten_site_tagline_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_site_tagline_font_size',array(
		'type' => 'number',
		'label' => __('Site Tagline Font Size','play-school-kindergarten'),
		'section' => 'title_tagline',
	));

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


	$wp_customize->add_panel( 'play_school_kindergarten_panel_id', array(
	   'priority' => 10,
	   'capability' => 'edit_theme_options',
	   'theme_supports' => '',
	   'title' => __( 'Theme Settings', 'play-school-kindergarten' ),
	   'description' => __( 'Description of what this panel does.', 'play-school-kindergarten' ),
	) );

	$wp_customize->add_section( 'play_school_kindergarten_theme_options_section', array(
    	'title'      => __( 'General Settings', 'play-school-kindergarten' ),
		'priority'   => 30,
		'panel' => 'play_school_kindergarten_panel_id'
	) );

	$wp_customize->add_setting('play_school_kindergarten_blog_theme_options',array(
		'default' => 'One Column',
		'sanitize_callback' => 'play_school_kindergarten_sanitize_choices'
	));
	$wp_customize->add_control('play_school_kindergarten_blog_theme_options',array(
		'type' => 'select',
		'label' => __('Blog Page Sidebar Layout','play-school-kindergarten'),
		'section' => 'play_school_kindergarten_theme_options_section',
		'choices' => array(
		   'Left Sidebar' => __('Left Sidebar','play-school-kindergarten'),
		   'Right Sidebar' => __('Right Sidebar','play-school-kindergarten'),
		   'One Column' => __('One Column','play-school-kindergarten'),
		   'Grid Layout' => __('Grid Layout','play-school-kindergarten')
		),
	));

	$wp_customize->add_setting('play_school_kindergarten_single_post_sidebar',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'play_school_kindergarten_sanitize_choices'
	));
	$wp_customize->add_control('play_school_kindergarten_single_post_sidebar',array(
        'type' => 'select',
        'label' => __('Single Post Sidebar Layout','play-school-kindergarten'),
        'section' => 'play_school_kindergarten_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','play-school-kindergarten'),
            'Right Sidebar' => __('Right Sidebar','play-school-kindergarten'),
            'One Column' => __('One Column','play-school-kindergarten')
        ),
	));

	$wp_customize->add_setting('play_school_kindergarten_archive_page_sidebar',array(
		'default' => 'One Column',
		'sanitize_callback' => 'play_school_kindergarten_sanitize_choices'
	));
	$wp_customize->add_control('play_school_kindergarten_archive_page_sidebar',array(
        'type' => 'select',
        'label' => __('Archive & Search Page Sidebar Layout','play-school-kindergarten'),
        'section' => 'play_school_kindergarten_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','play-school-kindergarten'),
            'Right Sidebar' => __('Right Sidebar','play-school-kindergarten'),
            'One Column' => __('One Column','play-school-kindergarten'),
            'Grid Layout' => __('Grid Layout','play-school-kindergarten')
        ),
	));

	$wp_customize->add_setting( 'play_school_kindergarten_boxfull_width', array(
		'default'           => '',
		'sanitize_callback' => 'play_school_kindergarten_sanitize_choices'
	));
	
	$wp_customize->add_control( 'play_school_kindergarten_boxfull_width', array(
		'label'    => __( 'Section Width', 'play-school-kindergarten' ),
		'section'  => 'play_school_kindergarten_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'container'  => __('Box Width', 'play-school-kindergarten'),
			'container-fluid' => __('Full Width', 'play-school-kindergarten'),
			'none' => __('None', 'play-school-kindergarten')
		),
	));

	$wp_customize->add_setting( 'play_school_kindergarten_dropdown_anim', array(
		'default'           => 'None',
		'sanitize_callback' => 'play_school_kindergarten_sanitize_choices'
	));
	$wp_customize->add_control( 'play_school_kindergarten_dropdown_anim', array(
		'label'    => __( 'Menu Dropdown Animations', 'play-school-kindergarten' ),
		'section'  => 'play_school_kindergarten_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInUp'  => __('bounceInUp', 'play-school-kindergarten'),
			'fadeInUp' => __('fadeInUp', 'play-school-kindergarten'),
			'zoomIn'    => __('zoomIn', 'play-school-kindergarten'),
			'None'    => __('None', 'play-school-kindergarten')
		),
	));

	// Contact Details
	$wp_customize->add_section( 'play_school_kindergarten_contact_details', array(
    	'title'      => __( 'Header Contact Details', 'play-school-kindergarten' ),
		'priority'   => null,
		'panel' => 'play_school_kindergarten_panel_id'
	) );

	$wp_customize->add_setting('play_school_kindergarten_hide_show_topbar',array(
    	'default' => false,
    	'sanitize_callback'	=> 'play_school_kindergarten_sanitize_checkbox'
	));
	$wp_customize->add_control('play_school_kindergarten_hide_show_topbar',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide Topbar','play-school-kindergarten'),
   	'section' => 'play_school_kindergarten_contact_details',
	));

	$wp_customize->add_setting('play_school_kindergarten_facebook',array(
		'default'=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('play_school_kindergarten_facebook',array(
		'label'	=> __('Add Facebook link','play-school-kindergarten'),
		'section'=> 'play_school_kindergarten_contact_details',
		'setting'=> 'play_school_kindergarten_facebook',
		'type'=> 'url'
	));

	$wp_customize->add_setting('play_school_kindergarten_twitter',array(
		'default'=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('play_school_kindergarten_twitter',array(
		'label'	=> __('Add Twitter Link','play-school-kindergarten'),
		'section'=> 'play_school_kindergarten_contact_details',
		'setting'=> 'play_school_kindergarten_twitter',
		'type'=> 'url'
	));

	$wp_customize->add_setting('play_school_kindergarten_linkdin',array(
		'default'=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('play_school_kindergarten_linkdin',array(
		'label'	=> __('Add Linkedin Link','play-school-kindergarten'),
		'section'=> 'play_school_kindergarten_contact_details',
		'setting'=> 'play_school_kindergarten_linkdin',
		'type'=> 'url'
	));	

	$wp_customize->add_setting('play_school_kindergarten_instagram',array(
		'default'=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('play_school_kindergarten_instagram',array(
		'label'	=> __('Add Instagram Link','play-school-kindergarten'),
		'section'=> 'play_school_kindergarten_contact_details',
		'setting'=> 'play_school_kindergarten_instagram',
		'type'=> 'url'
	));

	$wp_customize->add_setting('play_school_kindergarten_mail',array(
		'default'=> '',
		'sanitize_callback'	=> 'sanitize_email'
	));	
	$wp_customize->add_control('play_school_kindergarten_mail',array(
		'label'	=> __('Email Address','play-school-kindergarten'),
		'section'=> 'play_school_kindergarten_contact_details',
		'setting'=> 'play_school_kindergarten_mail',
		'type'=> 'text'
	));	

	$wp_customize->add_setting('play_school_kindergarten_location',array(
		'default'=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('play_school_kindergarten_location',array(
		'label'	=> __('Address','play-school-kindergarten'),
		'section'=> 'play_school_kindergarten_contact_details',
		'setting'=> 'play_school_kindergarten_location',
		'type'=> 'text'
	));

	$wp_customize->add_setting('play_school_kindergarten_button_text',array(
		'default'=> 'Our Courses',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('play_school_kindergarten_button_text',array(
		'label'	=> __('Add Courses Text','play-school-kindergarten'),
		'section'=> 'play_school_kindergarten_contact_details',
		'setting'=> 'play_school_kindergarten_button_text',
		'type'=> 'text'
	));

	$wp_customize->add_setting('play_school_kindergarten_button_link',array(
		'default'=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('play_school_kindergarten_button_link',array(
		'label'	=> __('Add Courses Page Link','play-school-kindergarten'),
		'section'=> 'play_school_kindergarten_contact_details',
		'setting'=> 'play_school_kindergarten_button_link',
		'type'=> 'url'
	));

	$wp_customize->add_setting( 'play_school_kindergarten_header_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	 ));
	 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'play_school_kindergarten_header_color', array(
		'label' => 'Top Bar Background Color',
		'section' => 'play_school_kindergarten_contact_details',
	 )));

	//home page slider
	$wp_customize->add_section( 'play_school_kindergarten_slider' , array(
    	'title'      => __( 'Slider Settings', 'play-school-kindergarten' ),
		'priority'   => null,
		'panel' => 'play_school_kindergarten_panel_id'
	) );

	$wp_customize->add_setting('play_school_kindergarten_slider_hide_show',array(
		'default' => false,
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_checkbox'
	));
	$wp_customize->add_control('play_school_kindergarten_slider_hide_show',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Slider','play-school-kindergarten'),
		'section' => 'play_school_kindergarten_slider'
	));

	$wp_customize->add_setting( 'play_school_kindergarten_slider_effect', array(
		'default'           => '',
		'sanitize_callback' => 'play_school_kindergarten_sanitize_choices'
	));
	$wp_customize->add_control( 'play_school_kindergarten_slider_effect', array(
		'label'    => __( 'Onload Transactions Effects', 'play-school-kindergarten' ),
		'section'  => 'play_school_kindergarten_slider',
		'type'     => 'select',
		'choices'  => array(
			'bounceInLeft'  => __('bounceInLeft', 'play-school-kindergarten'),
			'bounceInRight' => __('bounceInRight', 'play-school-kindergarten'),
			'bounceInUp'    => __('bounceInUp', 'play-school-kindergarten'),
			'bounceInDown'    => __('bounceInDown', 'play-school-kindergarten'),
			'zoomIn'  => __('zoomIn', 'play-school-kindergarten'),
			'zoomOut' => __('zoomOut', 'play-school-kindergarten'),
			'fadeInDown'    => __('fadeInDown', 'play-school-kindergarten'),
			'fadeInUp'    => __('fadeInUp', 'play-school-kindergarten'),
			'fadeInLeft'  => __('fadeInLeft', 'play-school-kindergarten'),
			'fadeInRight' => __('fadeInRight', 'play-school-kindergarten'),
			'flip-up'    => __('flip-up', 'play-school-kindergarten'),
			'none'    => __('none', 'play-school-kindergarten')
		),
	));

	for ( $count = 1; $count <= 4; $count++ ) {
		$wp_customize->add_setting( 'play_school_kindergarten_slide_page' . $count, array(
			'default'           => '',
			'sanitize_callback' => 'play_school_kindergarten_sanitize_dropdown_pages'
		) );
		$wp_customize->add_control( 'play_school_kindergarten_slide_page' . $count, array(
			'label'    => __( 'Select Slide Image Page', 'play-school-kindergarten' ),
			'section'  => 'play_school_kindergarten_slider',
			'type'     => 'dropdown-pages'
		) );
	}

	$wp_customize->add_setting('play_school_kindergarten_slider_excerpt_length',array(
		'default' => '15',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_slider_excerpt_length',array(
		'type' => 'number',
		'label' => __('Slider Excerpt Length','play-school-kindergarten'),
		'section' => 'play_school_kindergarten_slider',
	));

	$wp_customize->add_setting('play_school_kindergarten_slider_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_slider_title_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','play-school-kindergarten'),
		'section' => 'play_school_kindergarten_slider',
	));

	$wp_customize->add_setting('play_school_kindergarten_slider_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_slider_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','play-school-kindergarten'),
		'section' => 'play_school_kindergarten_slider',
	));

	$wp_customize->add_setting('play_school_kindergarten_slider_btn_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_slider_btn_font_size',array(
		'type' => 'number',
		'label' => __('Button Font Size','play-school-kindergarten'),
		'section' => 'play_school_kindergarten_slider',
	));

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

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

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

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

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

	 $wp_customize->add_setting( 'play_school_kindergarten_slidernp_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	 ));
	 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'play_school_kindergarten_slidernp_color', array(
		'label' => 'N/P Arrow Color',
		'section' => 'play_school_kindergarten_slider',
	 )));

	//About
	$wp_customize->add_section('play_school_kindergarten_about1',array(
		'title'	=> __('About Section','play-school-kindergarten'),
		'description'	=> __('Add About sections below.','play-school-kindergarten'),
		'panel' => 'play_school_kindergarten_panel_id',
	));

	$wp_customize->add_setting('play_school_kindergarten_about_name',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('play_school_kindergarten_about_name',array(
		'label'	=> __('Title','play-school-kindergarten'),
		'section'	=> 'play_school_kindergarten_about1',
		'setting'	=> 'play_school_kindergarten_about_name',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('play_school_kindergarten_about_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_about_title_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','play-school-kindergarten'),
		'section' => 'play_school_kindergarten_about1',
	));

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

	$args = array('numberposts' => -1);
	$post_list = get_posts($args);
	$i = 0;
	foreach($post_list as $post){
		$posts[$post->post_title] = $post->post_title;
	}

	$wp_customize->add_setting('play_school_kindergarten_about_setting',array(
		'sanitize_callback' => 'play_school_kindergarten_sanitize_choices',
	));
	$wp_customize->add_control('play_school_kindergarten_about_setting',array(
		'type'    => 'select',
		'choices' => $posts,
		'label' => __('Select post','play-school-kindergarten'),
		'section' => 'play_school_kindergarten_about1',
	));

	$wp_customize->add_setting('play_school_kindergarten_about_post_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_about_post_title_font_size',array(
		'type' => 'number',
		'label' => __('Post Title Font Size','play-school-kindergarten'),
		'section' => 'play_school_kindergarten_about1',
	));

	$wp_customize->add_setting('play_school_kindergarten_about_post_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_about_post_text_font_size',array(
		'type' => 'number',
		'label' => __('Post Text Font Size','play-school-kindergarten'),
		'section' => 'play_school_kindergarten_about1',
	));

	$wp_customize->add_setting('play_school_kindergarten_about_section_padding',array(
      'default' => '',
      'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_about_section_padding',array(
		'type' => 'number',
		'label' => __('Section Top & Bottom Padding','play-school-kindergarten'),
		'section' => 'play_school_kindergarten_about1',
	));

 	$wp_customize->add_setting('play_school_kindergarten_img_hight',array(
		'default' => '',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_img_hight',array(
		'type' => 'number',
		'label' => __('Image Hight','play-school-kindergarten'),
		'section' => 'play_school_kindergarten_about1',
	));

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

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

	//Footer
   $wp_customize->add_section( 'play_school_kindergarten_footer', array(
    	'title'      => __( 'Footer Setting', 'play-school-kindergarten' ),
		'priority'   => null,
		'panel' => 'play_school_kindergarten_panel_id'
	) );

	$wp_customize->add_setting('play_school_kindergarten_show_back_totop',array(
 		'default' => true,
   	'sanitize_callback'	=> 'play_school_kindergarten_sanitize_checkbox'
	));
	$wp_customize->add_control('play_school_kindergarten_show_back_totop',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide Back to Top','play-school-kindergarten'),
   	'section' => 'play_school_kindergarten_footer'
	));

   $wp_customize->add_setting('play_school_kindergarten_footer_copy',array(
		'default'	=> 'Kindergarten WordPress Theme By Luzuk',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('play_school_kindergarten_footer_copy',array(
		'label'	=> __('Copyright Text','play-school-kindergarten'),
		'section'	=> 'play_school_kindergarten_footer',
		'setting'	=> 'play_school_kindergarten_footer_copy',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('play_school_kindergarten_footer_copylink',array(
		'default'	=> 'https://www.luzuk.com/products/free-kindergarten-wordpress-theme/',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('play_school_kindergarten_footer_copylink',array(
		'label'	=> __('Copyright Link','play-school-kindergarten'),
		'section'	=> 'play_school_kindergarten_footer',
		'setting'	=> 'play_school_kindergarten_footer_copylink',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('play_school_kindergarten_footer_copy_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'play_school_kindergarten_sanitize_float'
	));
	$wp_customize->add_control('play_school_kindergarten_footer_copy_font_size',array(
		'type' => 'number',
		'label' => __('Copyright Font Size','play-school-kindergarten'),
		'section' => 'play_school_kindergarten_footer',
	));

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

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

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

	$wp_customize->add_setting( 'play_school_kindergarten_copyrightbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'play_school_kindergarten_copyrightbg_color', array(
		'label' => 'Copyright Background Color',
		'section' => 'play_school_kindergarten_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' => 'play_school_kindergarten_customize_partial_blogname',
	) );
	$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
		'selector' => '.site-description',
		'render_callback' => 'play_school_kindergarten_customize_partial_blogdescription',
	) );
}
add_action( 'customize_register', 'play_school_kindergarten_customize_register' );

function play_school_kindergarten_sanitize_colorscheme( $input ) {
	$valid = array( 'light', 'dark', 'custom' );

	if ( in_array( $input, $valid, true ) ) {
		return $input;
	}

	return 'light';
}

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

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


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

function play_school_kindergarten_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 Play_School_Kindergarten_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( 'Play_School_Kindergarten_Customize_Section_Pro' );

		// Register sections.
		$manager->add_section(
			new Play_School_Kindergarten_Customize_Section_Pro(
				$manager,
				'play_school_kindergarten_example_1',
				array(
					'priority' => 9,
					'title'    => esc_html__( 'Kindergarten Pro Theme', 'play-school-kindergarten' ),
					'pro_text' => esc_html__( 'Go Pro', 'play-school-kindergarten' ),
					'pro_url'  => esc_url( 'https://www.luzuk.com/products/premium-kindergarten-wordpress-theme/' ),
				)
			)
		);
	}

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

		wp_enqueue_script( 'play-school-kindergarten-customize-controls', trailingslashit( esc_url(get_template_directory_uri()) ) . '/assets/js/customize-controls.js', array( 'customize-controls' ) );

		wp_enqueue_style( 'play-school-kindergarten-customize-controls', trailingslashit( esc_url(get_template_directory_uri()) ) . '/assets/css/customize-controls.css' );
	}
}

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