<?php
/**
 * Plumbing Agency: Customizer
 *
 * @subpackage Plumbing Agency
 * @since 1.0
 */

use WPTRT\Customize\Section\Plumbing_Agency_Button;

add_action( 'customize_register', function( $manager ) {

	$manager->register_section_type( Plumbing_Agency_Button::class );

	$manager->add_section(
		new Plumbing_Agency_Button( $manager, 'plumbing_agency_pro', [
			'title' => __( 'Plumbing Agency Pro', 'plumbing-agency' ),
			'priority' => 0,
			'button_text' => __( 'Go Pro', 'plumbing-agency' ),
			'button_url'  => esc_url( 'https://www.luzuk.com/products/plumbing-agency-wordpress-theme', 'plumbing-agency')
		] )
	);

} );

// Load the JS and CSS.
add_action( 'customize_controls_enqueue_scripts', function() {

	$version = wp_get_theme()->get( 'Version' );

	wp_enqueue_script(
		'plumbing-agency-customize-section-button',
		get_theme_file_uri( 'vendor/wptrt/customize-section-button/public/js/customize-controls.js' ),
		[ 'customize-controls' ],
		$version,
		true
	);

	wp_enqueue_style(
		'plumbing-agency-customize-section-button',
		get_theme_file_uri( 'vendor/wptrt/customize-section-button/public/css/customize-controls.css' ),
		[ 'customize-controls' ],
 		$version
	);

} );

function plumbing_agency_customize_register( $wp_customize ) {

	$wp_customize->add_setting('plumbing_agency_logo_size',array(
		'sanitize_callback'	=> 'plumbing_agency_sanitize_float'
	));
	$wp_customize->add_control('plumbing_agency_logo_size',array(
		'type' => 'range',
		'label' => __('Logo Size','plumbing-agency'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('plumbing_agency_logo_padding',array(
		'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('plumbing_agency_logo_padding',array(
		'label' => __('Logo Margin','plumbing-agency'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('plumbing_agency_logo_top_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'plumbing_agency_sanitize_float'
	));
	$wp_customize->add_control('plumbing_agency_logo_top_padding',array(
		'type' => 'number',
		'description' => __('Top','plumbing-agency'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('plumbing_agency_logo_bottom_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'plumbing_agency_sanitize_float'
	));
	$wp_customize->add_control('plumbing_agency_logo_bottom_padding',array(
		'type' => 'number',
		'description' => __('Bottom','plumbing-agency'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('plumbing_agency_logo_left_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'plumbing_agency_sanitize_float'
	));
	$wp_customize->add_control('plumbing_agency_logo_left_padding',array(
		'type' => 'number',
		'description' => __('Left','plumbing-agency'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('plumbing_agency_logo_right_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'plumbing_agency_sanitize_float'
 	));
 	$wp_customize->add_control('plumbing_agency_logo_right_padding',array(
		'type' => 'number',
		'description' => __('Right','plumbing-agency'),
		'section' => 'title_tagline',
    ));

	$wp_customize->add_setting('plumbing_agency_show_site_title',array(
		'default' => true,
		'sanitize_callback'	=> 'plumbing_agency_sanitize_checkbox'
	));
	$wp_customize->add_control('plumbing_agency_show_site_title',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Title','plumbing-agency'),
		'section' => 'title_tagline'
	));

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

	$wp_customize->add_setting('plumbing_agency_show_tagline',array(
		'default' => true,
		'sanitize_callback'	=> 'plumbing_agency_sanitize_checkbox'
	));
	$wp_customize->add_control('plumbing_agency_show_tagline',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Tagline','plumbing-agency'),
		'section' => 'title_tagline'
	));

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

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

	$wp_customize->add_section( 'plumbing_agency_theme_options_section', array(
    	'title'      => __( 'General Settings', 'plumbing-agency' ),
		'priority'   => 30,
		'panel' => 'plumbing_agency_panel_id'
	) );

	$wp_customize->add_setting('plumbing_agency_theme_options',array(
		'default' => 'One Column',
		'sanitize_callback' => 'plumbing_agency_sanitize_choices'
	));
	$wp_customize->add_control('plumbing_agency_theme_options',array(
		'type' => 'select',
		'label' => __('Blog Page Sidebar Layout','plumbing-agency'),
		'section' => 'plumbing_agency_theme_options_section',
		'choices' => array(
		   'Left Sidebar' => __('Left Sidebar','plumbing-agency'),
		   'Right Sidebar' => __('Right Sidebar','plumbing-agency'),
		   'One Column' => __('One Column','plumbing-agency'),
		   'Grid Layout' => __('Grid Layout','plumbing-agency')
		),
	));

	$wp_customize->add_setting('plumbing_agency_single_post_sidebar',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'plumbing_agency_sanitize_choices'
	));
	$wp_customize->add_control('plumbing_agency_single_post_sidebar',array(
        'type' => 'select',
        'label' => __('Single Post Sidebar Layout','plumbing-agency'),
        'section' => 'plumbing_agency_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','plumbing-agency'),
            'Right Sidebar' => __('Right Sidebar','plumbing-agency'),
            'One Column' => __('One Column','plumbing-agency')
        ),
	));

	$wp_customize->add_setting('plumbing_agency_page_sidebar',array(
		'default' => 'One Column',
		'sanitize_callback' => 'plumbing_agency_sanitize_choices'
	));
	$wp_customize->add_control('plumbing_agency_page_sidebar',array(
        'type' => 'select',
        'label' => __('Page Sidebar Layout','plumbing-agency'),
        'section' => 'plumbing_agency_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','plumbing-agency'),
            'Right Sidebar' => __('Right Sidebar','plumbing-agency'),
            'One Column' => __('One Column','plumbing-agency')
        ),
	));

	$wp_customize->add_setting('plumbing_agency_archive_page_sidebar',array(
		'default' => 'One Column',
		'sanitize_callback' => 'plumbing_agency_sanitize_choices'
	));
	$wp_customize->add_control('plumbing_agency_archive_page_sidebar',array(
        'type' => 'select',
        'label' => __('Archive & Search Page Sidebar Layout','plumbing-agency'),
        'section' => 'plumbing_agency_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','plumbing-agency'),
            'Right Sidebar' => __('Right Sidebar','plumbing-agency'),
            'One Column' => __('One Column','plumbing-agency'),
            'Grid Layout' => __('Grid Layout','plumbing-agency')
        ),
	));

	$wp_customize->add_setting( 'plumbing_agency_boxfull_width', array(
		'default'           => '',
		'sanitize_callback' => 'plumbing_agency_sanitize_choices'
	));
	
	$wp_customize->add_control( 'plumbing_agency_boxfull_width', array(
		'label'    => __( 'Section Width', 'plumbing-agency' ),
		'section'  => 'plumbing_agency_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'container'  => __('Box Width', 'plumbing-agency'),
			'container-fluid' => __('Full Width', 'plumbing-agency'),
			'none' => __('None', 'plumbing-agency')
		),
	));

	$wp_customize->add_setting( 'plumbing_agency_dropdown_anim', array(
		'default'           => 'None',
		'sanitize_callback' => 'plumbing_agency_sanitize_choices'
	));
	$wp_customize->add_control( 'plumbing_agency_dropdown_anim', array(
		'label'    => __( 'Menu Dropdown Animations', 'plumbing-agency' ),
		'section'  => 'plumbing_agency_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInUp'  => __('bounceInUp', 'plumbing-agency'),
			'fadeInUp' => __('fadeInUp', 'plumbing-agency'),
			'zoomIn'    => __('zoomIn', 'plumbing-agency'),
			'None'    => __('None', 'plumbing-agency')
		),
	));

	//Header
	$wp_customize->add_section( 'plumbing_agency_header' , array(
    	'title'    => __( 'Header Section', 'plumbing-agency' ),
		'priority' => null,
		'panel' => 'plumbing_agency_panel_id'
	) );


	$wp_customize->add_setting('plumbing_agency_email',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('plumbing_agency_email',array(
	   	'type' => 'text',
	   	'label' => __('Add Mail','plumbing-agency'),
	   	'section' => 'plumbing_agency_header',
	));

	$wp_customize->add_setting('plumbing_agency_facebook_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('plumbing_agency_facebook_url',array(
	   	'type' => 'url',
	   	'label' => __('Add Facebook URL','plumbing-agency'),
	   	'section' => 'plumbing_agency_header',
	));

	$wp_customize->add_setting('plumbing_agency_twitter_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('plumbing_agency_twitter_url',array(
	   	'type' => 'url',
	   	'label' => __('Add Twitter URL','plumbing-agency'),
	   	'section' => 'plumbing_agency_header',
	));

	$wp_customize->add_setting('plumbing_agency_instagram_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('plumbing_agency_instagram_url',array(
	   	'type' => 'url',
	   	'label' => __('Add Instagram URL','plumbing-agency'),
	   	'section' => 'plumbing_agency_header',
	));

	$wp_customize->add_setting('plumbing_agency_headerbtn_text',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('plumbing_agency_headerbtn_text',array(
	   	'type' => 'text',
	   	'label' => __('Button Text','plumbing-agency'),
	   	'section' => 'plumbing_agency_header',
	));

	$wp_customize->add_setting('plumbing_agency_headerbtnlink',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('plumbing_agency_headerbtnlink',array(
	   	'type' => 'url',
	   	'label' => __('Button Link','plumbing-agency'),
	   	'section' => 'plumbing_agency_header',
	));

	$wp_customize->add_setting( 'plumbing_agency_email_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'plumbing_agency_email_color', array(
		'label' => 'Email Color',
		'section' => 'plumbing_agency_header',
	)));

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

	$wp_customize->add_setting( 'plumbing_agency_socialbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'plumbing_agency_socialbg_color', array(
		'label' => 'Social Icon Bg Color',
		'section' => 'plumbing_agency_header',
	)));

	$wp_customize->add_setting( 'plumbing_agency_menu_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'plumbing_agency_menu_color', array(
		'label' => 'Menu Color',
		'section' => 'plumbing_agency_header',
	)));

	$wp_customize->add_setting( 'plumbing_agency_submenu_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'plumbing_agency_submenu_color', array(
		'label' => 'Submenu Color',
		'section' => 'plumbing_agency_header',
	)));

	$wp_customize->add_setting( 'plumbing_agency_submenubg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'plumbing_agency_submenubg_color', array(
		'label' => 'Submenu Bg Color',
		'section' => 'plumbing_agency_header',
	)));

	//home page slider
	$wp_customize->add_section( 'plumbing_agency_slider_section' , array(
    	'title'    => __( 'Slider Settings', 'plumbing-agency' ),
		'priority' => null,
		'panel' => 'plumbing_agency_panel_id'
	) );

	$wp_customize->add_setting('plumbing_agency_slider_hide_show',array(
    	'default' => false,
    	'sanitize_callback'	=> 'plumbing_agency_sanitize_checkbox'
	));
	$wp_customize->add_control('plumbing_agency_slider_hide_show',array(
	   	'type' => 'checkbox',
	   	'label' => __('Show / Hide Slider','plumbing-agency'),
	   	'section' => 'plumbing_agency_slider_section',
	));

	$wp_customize->add_setting( 'plumbing_agency_slider_effect', array(
		'default'           => '',
		'sanitize_callback' => 'plumbing_agency_sanitize_choices'
	));
	$wp_customize->add_control( 'plumbing_agency_slider_effect', array(
		'label'    => __( 'Onload Transactions Effects', 'plumbing-agency' ),
		'section'  => 'plumbing_agency_slider_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInLeft'  => __('bounceInLeft', 'plumbing-agency'),
			'bounceInRight' => __('bounceInRight', 'plumbing-agency'),
			'bounceInUp'    => __('bounceInUp', 'plumbing-agency'),
			'bounceInDown'    => __('bounceInDown', 'plumbing-agency'),
			'zoomIn'  => __('zoomIn', 'plumbing-agency'),
			'zoomOut' => __('zoomOut', 'plumbing-agency'),
			'fadeInDown'    => __('fadeInDown', 'plumbing-agency'),
			'fadeInUp'    => __('fadeInUp', 'plumbing-agency'),
			'fadeInLeft'  => __('fadeInLeft', 'plumbing-agency'),
			'fadeInRight' => __('fadeInRight', 'plumbing-agency'),
			'flip-up'    => __('flip-up', 'plumbing-agency'),
			'none'    => __('none', 'plumbing-agency')
		),
	));

	for ( $count = 1; $count <= 4; $count++ ) {
		$wp_customize->add_setting( 'plumbing_agency_slider' . $count, array(
			'default'           => '',
			'sanitize_callback' => 'plumbing_agency_sanitize_dropdown_pages'
		));
		$wp_customize->add_control( 'plumbing_agency_slider' . $count, array(
			'label' => __('Select Slider Image Page', 'plumbing-agency' ),
			'section' => 'plumbing_agency_slider_section',
			'type' => 'dropdown-pages'
		));
	}

	$wp_customize->add_setting('plumbing_agency_slider_excerpt_length',array(
		'default' => '15',
		'sanitize_callback'	=> 'plumbing_agency_sanitize_float'
	));
	$wp_customize->add_control('plumbing_agency_slider_excerpt_length',array(
		'type' => 'number',
		'label' => __('Description Excerpt Length','plumbing-agency'),
		'section' => 'plumbing_agency_slider_section',
	));

	$wp_customize->add_setting('plumbing_agency_slider_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'plumbing_agency_sanitize_float'
	));
	$wp_customize->add_control('plumbing_agency_slider_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','plumbing-agency'),
		'section' => 'plumbing_agency_slider_section',
	));

	$wp_customize->add_setting('plumbing_agency_slider_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'plumbing_agency_sanitize_float'
	));
	$wp_customize->add_control('plumbing_agency_slider_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','plumbing-agency'),
		'section' => 'plumbing_agency_slider_section',
	));

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

	$wp_customize->add_control('plumbing_agency_sliderbtnlink',array(
	   	'type' => 'url',
	   	'label' => __('ContactUs Button Link','plumbing-agency'),
	   	'section' => 'plumbing_agency_slider_section',
	));

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

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

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

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

	$wp_customize->add_setting( 'plumbing_agency_slider_npbtn_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'plumbing_agency_slider_npbtn_color', array(
		'label' => 'Next/Pre Arrow Color',
		'section' => 'plumbing_agency_slider_section',
	)));

	//Service Section
	$wp_customize->add_section('plumbing_agency_service_section',array(
		'title'	=> __('Service Section','plumbing-agency'),
		'description'=> __('<b>Note :</b> This section will appear below the slider.','plumbing-agency'),
		'panel' => 'plumbing_agency_panel_id',
	));

	$wp_customize->add_setting('plumbing_agency_serviceheading',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('plumbing_agency_serviceheading',array(
	   	'type' => 'text',
	   	'label' => __('Heading','plumbing-agency'),
	   	'section' => 'plumbing_agency_service_section',
	));

	$wp_customize->add_setting('plumbing_agency_serviceheading_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'plumbing_agency_sanitize_float'
	));
	$wp_customize->add_control('plumbing_agency_serviceheading_font_size',array(
		'type' => 'number',
		'label' => __('Heading Font Size','plumbing-agency'),
		'section' => 'plumbing_agency_service_section',
	));

	$wp_customize->add_setting('plumbing_agency_servicesubheading',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('plumbing_agency_servicesubheading',array(
	   	'type' => 'text',
	   	'label' => __('Sub Heading Text','plumbing-agency'),
	   	'section' => 'plumbing_agency_service_section',
	));

	$wp_customize->add_setting('plumbing_agency_servicesubheading_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'plumbing_agency_sanitize_float'
	));
	$wp_customize->add_control('plumbing_agency_servicesubheading_font_size',array(
		'type' => 'number',
		'label' => __('Sub Heading Font Size','plumbing-agency'),
		'section' => 'plumbing_agency_service_section',
	));

	$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('plumbing_agency_service_category_setting',array(
		'default' => 'select',
		'sanitize_callback' => 'plumbing_agency_sanitize_choices',
	));
	$wp_customize->add_control('plumbing_agency_service_category_setting',array(
		'type' => 'select',
		'choices' => $cat_pst,
		'label' => __('Select Category To Display Post','plumbing-agency'),
		'section' => 'plumbing_agency_service_section',
	));

	$wp_customize->add_setting('plumbing_agency_service_number',array(
		'default'	=> '4',
		'sanitize_callback'	=> 'sanitize_text_field',
	));
	$wp_customize->add_control('plumbing_agency_service_number',array(
		'label'	=> __('Number Of Posts To Show In A Category','plumbing-agency'),
		'section' => 'plumbing_agency_service_section',
		'type'	  => 'number'
	));

	$plumbing_agency_service_number = get_theme_mod('plumbing_agency_service_number', 4);
	for ($i=1; $i <= $plumbing_agency_service_number; $i++) { 
	   	$wp_customize->add_setting('plumbing_agency_service_icon' . $i, array(
	      	'default' => 'fa fa-user',
	      	'sanitize_callback' => 'sanitize_text_field'
	   	));
	   	$wp_customize->add_control(new Plumbing_Agency_Fontawesome_Icon_Chooser($wp_customize, 'plumbing_agency_service_icon' . $i, array(
	      	'section' => 'plumbing_agency_service_section',
	      	'type' => 'icon',
	      	'label' => esc_html__('Service Icon ', 'plumbing-agency') . $i
	  	)));
	}


	//Footer
    $wp_customize->add_section( 'plumbing_agency_footer', array(
    	'title'  => __( 'Footer Settings', 'plumbing-agency' ),
		'priority' => null,
		'panel' => 'plumbing_agency_panel_id'
	) );

	$wp_customize->add_setting('plumbing_agency_show_back_totop',array(
       'default' => true,
       'sanitize_callback'	=> 'plumbing_agency_sanitize_checkbox'
    ));
    $wp_customize->add_control('plumbing_agency_show_back_totop',array(
       'type' => 'checkbox',
       'label' => __('Show / Hide Back to Top','plumbing-agency'),
       'section' => 'plumbing_agency_footer'
    ));

    $wp_customize->add_setting('plumbing_agency_footer_copy',array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('plumbing_agency_footer_copy',array(
		'label'	=> __('Copyright Text','plumbing-agency'),
		'section' => 'plumbing_agency_footer',
		'setting' => 'plumbing_agency_footer_copy',
		'type' => 'text'
	));

	$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' => 'plumbing_agency_customize_partial_blogname',
	) );
	$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
		'selector' => '.site-description',
		'render_callback' => 'plumbing_agency_customize_partial_blogdescription',
	) );
}
add_action( 'customize_register', 'plumbing_agency_customize_register' );

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

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

if (class_exists('WP_Customize_Control')) {

   	class Plumbing_Agency_Fontawesome_Icon_Chooser extends WP_Customize_Control {

      	public $type = 'icon';

      	public function render_content() { ?>
	     	<label>
	            <span class="customize-control-title">
	               <?php echo esc_html($this->label); ?>
	            </span>

	            <?php if ($this->description) { ?>
	                <span class="description customize-control-description">
	                   <?php echo wp_kses_post($this->description); ?>
	                </span>
	            <?php } ?>

	            <div class="plumbing-agency-selected-icon">
	                <i class="fa <?php echo esc_attr($this->value()); ?>"></i>
	                <span><i class="fa fa-angle-down"></i></span>
	            </div>

	            <ul class="plumbing-agency-icon-list clearfix">
	                <?php
	                $plumbing_agency_font_awesome_icon_array = plumbing_agency_font_awesome_icon_array();
	                foreach ($plumbing_agency_font_awesome_icon_array as $plumbing_agency_font_awesome_icon) {
	                   $icon_class = $this->value() == $plumbing_agency_font_awesome_icon ? 'icon-active' : '';
	                   echo '<li class=' . esc_attr($icon_class) . '><i class="' . esc_attr($plumbing_agency_font_awesome_icon) . '"></i></li>';
	                }
	                ?>
	            </ul>
	            <input type="hidden" value="<?php $this->value(); ?>" <?php $this->link(); ?> />
	        </label>
	        <?php
      	}
  	}
}
function plumbing_agency_customizer_script() {
   wp_enqueue_style( 'font-awesome-1', esc_url(get_template_directory_uri()).'/assets/css/fontawesome-all.css');
}
add_action( 'customize_controls_enqueue_scripts', 'plumbing_agency_customizer_script' );