<?php
/**
 * Classic Law Firm Theme Customizer
 *
 * @package Classic Law Firm
 */

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function classic_law_firm_customize_register( $wp_customize ) {

	function classic_law_firm_sanitize_dropdown_pages( $page_id, $setting ) {
  		$page_id = absint( $page_id );
  		return ( 'publish' == get_post_status( $page_id ) ? $page_id : $setting->default );
	}

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

	wp_enqueue_style('classic-law-firm-customize-controls', trailingslashit(esc_url(get_template_directory_uri())).'/css/customize-controls.css');

	if ( class_exists( 'WP_Customize_Control' ) ) {
		require_once get_template_directory() . '/inc/customizer-custom-controls.php';
	}

	// Enable / Disable Logo
	$wp_customize->add_setting('classic_law_firm_logo_enable',array(
		'default' => true,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
	));
	$wp_customize->add_control( 'classic_law_firm_logo_enable', array(
		'settings' => 'classic_law_firm_logo_enable',
		'section'   => 'title_tagline',
		'label'     => __('Enable Logo','classic-law-firm'),
		'type'      => 'checkbox'
	));

	//Logo
    $wp_customize->add_setting('classic_law_firm_logo_width', array(
        'default' => '',
        'transport' => 'refresh',
        'sanitize_callback' => 'classic_law_firm_sanitize_integer'
    ));
    $wp_customize->add_control(new Classic_Law_Firm_Slider_Custom_Control($wp_customize, 'classic_law_firm_logo_width', array(
    	'label'          => __( 'Logo Width', 'classic-law-firm'),
        'section' => 'title_tagline',
        'settings' => 'classic_law_firm_logo_width',
        'input_attrs' => array(
            'step' => 1,
            'min' => 0,
            'max' => 300,
        ),
    )));

	// color site title
	$wp_customize->add_setting('classic_law_firm_sitetitle_color',array(
		'default' => '',
		'sanitize_callback' => 'classic_law_firm_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));

	$wp_customize->add_control( 'classic_law_firm_sitetitle_color', array(
	   'settings' => 'classic_law_firm_sitetitle_color',
	   'section'   => 'title_tagline',
	   'label' => __('Site Title Color', 'classic-law-firm'),
	   'type'      => 'color'
	));

	$wp_customize->add_setting('classic_law_firm_title_enable',array(
		'default' => false,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
	));
	$wp_customize->add_control( 'classic_law_firm_title_enable', array(
	   'settings' => 'classic_law_firm_title_enable',
	   'section'   => 'title_tagline',
	   'label'     => __('Enable Site Title','classic-law-firm'),
	   'type'      => 'checkbox'
	));

	// color site tagline
	$wp_customize->add_setting('classic_law_firm_sitetagline_color',array(
		'default' => '',
		'sanitize_callback' => 'classic_law_firm_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_sitetagline_color', array(
	   'settings' => 'classic_law_firm_sitetagline_color',
	   'section'   => 'title_tagline',
	   'label' => __('Site Tagline Color', 'classic-law-firm'),
	   'type'      => 'color'
	));

	$wp_customize->add_setting('classic_law_firm_tagline_enable',array(
		'default' => false,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
	));
	$wp_customize->add_control( 'classic_law_firm_tagline_enable', array(
	   'settings' => 'classic_law_firm_tagline_enable',
	   'section'   => 'title_tagline',
	   'label'     => __('Enable Site Tagline','classic-law-firm'),
	   'type'      => 'checkbox'
	));

	// woocommerce section
	$wp_customize->add_section('classic_law_firm_woocommerce_page_settings', array(
		'title'    => __('WooCommerce Page Settings', 'classic-law-firm'),
		'priority' => null,
		'panel'    => 'woocommerce',
	));

	$wp_customize->add_setting('classic_law_firm_shop_page_sidebar',array(
		'default' => false,
		'sanitize_callback'	=> 'classic_law_firm_sanitize_checkbox'
	 ));
	 $wp_customize->add_control('classic_law_firm_shop_page_sidebar',array(
		'type' => 'checkbox',
		'label' => __(' Check To Enable Shop page sidebar','classic-law-firm'),
		'section' => 'classic_law_firm_woocommerce_page_settings',
	 ));

    // shop page sidebar alignment
    $wp_customize->add_setting('classic_law_firm_shop_page_sidebar_position', array(
		'default'           => 'Right Sidebar',
		'sanitize_callback' => 'classic_law_firm_sanitize_choices',
	));
	$wp_customize->add_control('classic_law_firm_shop_page_sidebar_position',array(
		'type'           => 'radio',
		'label'          => __('Shop Page Sidebar', 'classic-law-firm'),
		'section'        => 'classic_law_firm_woocommerce_page_settings',
		'choices'        => array(
			'Left Sidebar'  => __('Left Sidebar', 'classic-law-firm'),
			'Right Sidebar' => __('Right Sidebar', 'classic-law-firm'),
		),
	));	 

	$wp_customize->add_setting('classic_law_firm_wooproducts_nav',array(
		'default' => 'Yes',
		'sanitize_callback'	=> 'classic_law_firm_sanitize_choices'
	 ));
	 $wp_customize->add_control('classic_law_firm_wooproducts_nav',array(
		'type' => 'select',
		'label' => __('Shop Page Products Navigation','classic-law-firm'),
		'choices' => array(
			 'Yes' => __('Yes','classic-law-firm'),
			 'No' => __('No','classic-law-firm'),
		 ),
		'section' => 'classic_law_firm_woocommerce_page_settings',
	 ));

	 $wp_customize->add_setting( 'classic_law_firm_single_page_sidebar',array(
		'default' => false,
		'sanitize_callback'	=> 'classic_law_firm_sanitize_checkbox'
    ) );
    $wp_customize->add_control('classic_law_firm_single_page_sidebar',array(
    	'type' => 'checkbox',
       	'label' => __('Check To Enable Single Product Page Sidebar','classic-law-firm'),
		'section' => 'classic_law_firm_woocommerce_page_settings'
    ));

	// single product page sidebar alignment
    $wp_customize->add_setting('classic_law_firm_single_product_page_layout', array(
		'default'           => 'Right Sidebar',
		'sanitize_callback' => 'classic_law_firm_sanitize_choices',
	));
	$wp_customize->add_control('classic_law_firm_single_product_page_layout',array(
		'type'           => 'radio',
		'label'          => __('Single product Page Sidebar', 'classic-law-firm'),
		'section'        => 'classic_law_firm_woocommerce_page_settings',
		'choices'        => array(
			'Left Sidebar'  => __('Left Sidebar', 'classic-law-firm'),
			'Right Sidebar' => __('Right Sidebar', 'classic-law-firm'),
		),
	));

	$wp_customize->add_setting('classic_law_firm_related_product_enable',array(
		'default' => true,
		'sanitize_callback'	=> 'classic_law_firm_sanitize_checkbox'
	));
	$wp_customize->add_control('classic_law_firm_related_product_enable',array(
		'type' => 'checkbox',
		'label' => __('Check To Enable Related product','classic-law-firm'),
		'section' => 'classic_law_firm_woocommerce_page_settings',
	));

	$wp_customize->add_setting( 'classic_law_firm_woo_product_img_border_radius', array(
        'default'              => '0',
        'transport'            => 'refresh',
        'sanitize_callback'    => 'classic_law_firm_sanitize_integer'
    ) );
    $wp_customize->add_control(new Classic_Law_Firm_Slider_Custom_Control( $wp_customize, 'classic_law_firm_woo_product_img_border_radius',array(
		'label'	=> esc_html__('Woo Product Img Border Radius','classic-law-firm'),
		'section'=> 'classic_law_firm_woocommerce_page_settings',
		'settings'=>'classic_law_firm_woo_product_img_border_radius',
		'input_attrs' => array(
            'step'             => 1,
			'min'              => 0,
			'max'              => 100,
        ),
	)));
    // Add a setting for number of products per row
    $wp_customize->add_setting('classic_law_firm_products_per_row', array(
	    'default'   => '4',
	    'transport' => 'refresh',
	    'sanitize_callback' => 'classic_law_firm_sanitize_integer'  
    ));

   $wp_customize->add_control('classic_law_firm_products_per_row', array(
	   'label'    => __('Products Per Row', 'classic-law-firm'),
	   'section'  => 'classic_law_firm_woocommerce_page_settings',
	   'settings' => 'classic_law_firm_products_per_row',
	   'type'     => 'select',
	   'choices'  => array(
		      '2' => '2',
		'      3' => '3',
		      '4' => '4',
	  ),
   ) );

   // Add a setting for the number of products per page
   $wp_customize->add_setting('classic_law_firm_products_per_page', array(
	'default'   => '9',
	'transport' => 'refresh',
	'sanitize_callback' => 'classic_law_firm_sanitize_integer'
   ));

   $wp_customize->add_control('classic_law_firm_products_per_page', array(
	  'label'    => __('Products Per Page', 'classic-law-firm'),
	  'section'  => 'classic_law_firm_woocommerce_page_settings',
	  'settings' => 'classic_law_firm_products_per_page',
	  'type'     => 'number',
	  'input_attrs' => array(
		 'min'  => 1,
		 'step' => 1,
	 ),
   ));	

   $wp_customize->add_setting('classic_law_firm_product_sale_position',array(
	'default' => 'Left',
	'sanitize_callback' => 'classic_law_firm_sanitize_choices'
	));
	$wp_customize->add_control('classic_law_firm_product_sale_position',array(
		'type' => 'radio',
		'label' => __('Product Sale Position','classic-law-firm'),
		'section' => 'classic_law_firm_woocommerce_page_settings',
		'choices' => array(
			'Left' => __('Left','classic-law-firm'),
			'Right' => __('Right','classic-law-firm'),
		),
	) );   

	//Theme Options
	$wp_customize->add_panel( 'classic_law_firm_panel_area', array(
		'priority' => 10,
		'capability' => 'edit_theme_options',
		'title' => __( 'Theme Options Panel', 'classic-law-firm' ),
	) );

	//Site Layout Section
	$wp_customize->add_section('classic_law_firm_site_layoutsec',array(
		'title'	=> __('Manage Site Layout Section ','classic-law-firm'),
		'description' => __('<p class="sec-title">Manage Site Layout Section</p>','classic-law-firm'),
		'priority'	=> 1,
		'panel' => 'classic_law_firm_panel_area',
	));

	$wp_customize->add_setting('classic_law_firm_preloader',array(
		'default' => false,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
	));
	$wp_customize->add_control( 'classic_law_firm_preloader', array(
	   'section'   => 'classic_law_firm_site_layoutsec',
	   'label'	=> __('Check to Show preloader','classic-law-firm'),
	   'type'      => 'checkbox'
 	));	

	$wp_customize->add_setting('classic_law_firm_box_layout',array(
		'default' => false,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
	));
	$wp_customize->add_control( 'classic_law_firm_box_layout', array(
	   'section'   => 'classic_law_firm_site_layoutsec',
	   'label'	=> __('Check to Show Box Layout','classic-law-firm'),
	   'type'      => 'checkbox'
 	));

	// Add Settings and Controls for Page Layout
    $wp_customize->add_setting('classic_law_firm_sidebar_page_layout',array(
		'default' => 'full',
	 	'sanitize_callback' => 'classic_law_firm_sanitize_choices'
	));
	$wp_customize->add_control('classic_law_firm_sidebar_page_layout',array(
		'type' => 'radio',
		'label'     => __('Theme Page Sidebar Position', 'classic-law-firm'),
		'section' => 'classic_law_firm_site_layoutsec',
		'choices' => array(
			'left' => __('Left','classic-law-firm'),
			'right' => __('Right','classic-law-firm'),
			'full' => __('No Sidebar','classic-law-firm')
	),
	));		

	$wp_customize->add_setting( 'classic_law_firm_layoutsec_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_layoutsec_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_LAW_FIRM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_law_firm_site_layoutsec'
	));

	//Global Color
	$wp_customize->add_section('classic_law_firm_global_color', array(
		'title'    => __('Manage Global Color Section', 'classic-law-firm'),
		'panel'    => 'classic_law_firm_panel_area',
	));

	$wp_customize->add_setting('classic_law_firm_first_color', array(
		'default'           => '#B8967E',
		'sanitize_callback' => 'sanitize_hex_color',
	));
	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'classic_law_firm_first_color', array(
		'label'    => __('Theme Color', 'classic-law-firm'),
		'section'  => 'classic_law_firm_global_color',
		'settings' => 'classic_law_firm_first_color',
	)));
	
	$wp_customize->add_setting( 'classic_law_firm_global_color_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_global_color_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_LAW_FIRM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_law_firm_global_color'
	));

	// Topbar Section
	$wp_customize->add_section('classic_law_firm_topbar_section',array(
	    'title' => __('Manage Topbar Section','classic-law-firm'),
	    'priority'  => null,
	    'panel' => 'classic_law_firm_panel_area',
	));	

	// Sticky Header
	$wp_customize->add_setting( 'classic_law_firm_sticky_header',array(
		'default' => false,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_sticky_header',array(
		'settings' => 'classic_law_firm_sticky_header',
		'section'   => 'classic_law_firm_topbar_section',
		'label' => esc_html__( 'Check To Enable Sticky Header','classic-law-firm' ),
		'type'      => 'checkbox'
	));

	$wp_customize->add_setting('classic_law_firm_enable_topbar_section',array(
		'default' => true,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_enable_topbar_section', array(
	   'settings' => 'classic_law_firm_enable_topbar_section',
	   'section'   => 'classic_law_firm_topbar_section',
	   'label'     => __('Check To Enable This Section','classic-law-firm'),
	   'type'      => 'checkbox'
	));

	$wp_customize->add_setting('classic_law_firm_location_title', array(
	    'default'           => '',
	    'sanitize_callback' => 'sanitize_text_field',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('classic_law_firm_location_title', array(
	    'settings' => 'classic_law_firm_location_title',
	    'section'  => 'classic_law_firm_topbar_section',
	    'label'    => __('Add Location Title', 'classic-law-firm'),
	    'type'     => 'text',
	));

	$wp_customize->add_setting('classic_law_firm_address_location',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_address_location', array(
	   'settings' => 'classic_law_firm_address_location',
	   'section'   => 'classic_law_firm_topbar_section',
	   'label' => __('Add Location Address', 'classic-law-firm'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting('classic_law_firm_track_locatin_url',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_track_locatin_url', array(
	   'settings' => 'classic_law_firm_track_locatin_url',
	   'section'   => 'classic_law_firm_topbar_section',
	   'label' => __('Location Link', 'classic-law-firm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_law_firm_email_title', array(
	    'default'           => '',
	    'sanitize_callback' => 'sanitize_text_field',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('classic_law_firm_email_title', array(
	    'settings' => 'classic_law_firm_email_title',
	    'section'  => 'classic_law_firm_topbar_section',
	    'label'    => __('Add Email Title', 'classic-law-firm'),
	    'type'     => 'text',
	));

	$wp_customize->add_setting('classic_law_firm_email_address',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_email',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_email_address', array(
	   'settings' => 'classic_law_firm_email_address',
	   'section'   => 'classic_law_firm_topbar_section',
	   'label' => __('Add Email Address', 'classic-law-firm'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting('classic_law_firm_phone_title', array(
	    'default'           => '',
	    'sanitize_callback' => 'sanitize_text_field',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('classic_law_firm_phone_title', array(
	    'settings' => 'classic_law_firm_phone_title',
	    'section'  => 'classic_law_firm_topbar_section',
	    'label'    => __('Add Phone Title', 'classic-law-firm'),
	    'type'     => 'text',
	));

	$wp_customize->add_setting('classic_law_firm_phone_number',array(
		'default' => '',
		'sanitize_callback' => 'classic_law_firm_sanitize_phone_number',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_phone_number', array(
	   'settings' => 'classic_law_firm_phone_number',
	   'section'   => 'classic_law_firm_topbar_section',
	   'label' => __('Add Phone Number', 'classic-law-firm'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting('classic_law_firm_fb_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_fb_link', array(
	   'settings' => 'classic_law_firm_fb_link',
	   'section'   => 'classic_law_firm_topbar_section',
	   'label' => __('Facebook Link', 'classic-law-firm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_law_firm_youtube_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_youtube_link', array(
	   'settings' => 'classic_law_firm_youtube_link',
	   'section'   => 'classic_law_firm_topbar_section',
	   'label' => __('Youtube Link', 'classic-law-firm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_law_firm_instagram_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_instagram_link', array(
	   'settings' => 'classic_law_firm_instagram_link',
	   'section'   => 'classic_law_firm_topbar_section',
	   'label' => __('Facebook Link', 'classic-law-firm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_law_firm_linkedin_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_linkedin_link', array(
	   'settings' => 'classic_law_firm_linkedin_link',
	   'section'   => 'classic_law_firm_topbar_section',
	   'label' => __('Linkedin Link', 'classic-law-firm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_law_firm_twitter_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_twitter_link', array(
	   'settings' => 'classic_law_firm_twitter_link',
	   'section'   => 'classic_law_firm_topbar_section',
	   'label' => __('Twitter Link', 'classic-law-firm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_law_firm_header_btn_text',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_header_btn_text', array(
	   'settings' => 'classic_law_firm_header_btn_text',
	   'section'   => 'classic_law_firm_topbar_section',
	   'label' => __('Add Button Text', 'classic-law-firm'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting('classic_law_firm_header_btn_url',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_header_btn_url', array(
	   'settings' => 'classic_law_firm_header_btn_url',
	   'section'   => 'classic_law_firm_topbar_section',
	   'label' => __('Add Button URL', 'classic-law-firm'),
	   'type'      => 'url'
	));

    // Menu Text Transform
    $wp_customize->add_setting( 'classic_law_firm_menu_text_transform', array(
        'default'           => 'Uppercase',
		'transport' => 'refresh',
		'sanitize_callback' => 'classic_law_firm_sanitize_choices'
    ));

    $wp_customize->add_control( 'classic_law_firm_menu_text_transform', array(
        'label'    => __( 'Menu Text Transform', 'classic-law-firm' ),
        'section'  => 'classic_law_firm_topbar_section',
        'type'     => 'select',
        'choices'  => array(
			'None'       => __( 'None', 'classic-law-firm' ),
            'Capitalize' => __( 'Capitalize', 'classic-law-firm' ),
            'Uppercase'  => __( 'Uppercase', 'classic-law-firm' ),
            'Lowercase'  => __( 'Lowercase', 'classic-law-firm' ),
        ),
    ));

	$wp_customize->add_setting( 'classic_law_firm_topbar_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_topbar_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_LAW_FIRM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_law_firm_topbar_section'
	));

    // Slider Section
	$wp_customize->add_section('classic_law_firm_slider_section',array(
	    'title' => __('Manage Slider Section','classic-law-firm'),
	    'priority'  => null,
	    'description'	=> __('<p class="sec-title">Manage Slider Section</p> Select Category from the Dropdowns for slider, Also use the given image dimension (1200 x 600).','classic-law-firm'),
	    'panel' => 'classic_law_firm_panel_area',
	));	

	$wp_customize->add_setting('classic_law_firm_slider',array(
		'default' => true,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_slider', array(
	   'settings' => 'classic_law_firm_slider',
	   'section'   => 'classic_law_firm_slider_section',
	   'label'     => __('Check To Enable This Section','classic-law-firm'),
	   'type'      => 'checkbox'
	));

	$classic_law_firm_categories = get_categories();
	$classic_law_firm_cat_post = array();
	$classic_law_firm_cat_post['0'] = 'Select';

	foreach ($classic_law_firm_categories as $classic_law_firm_category) {
	    $classic_law_firm_cat_post[$classic_law_firm_category->slug] = $classic_law_firm_category->name;
	}

	$wp_customize->add_setting('classic_law_firm_slider_cat', array(
	    'default' => '0',
	    'sanitize_callback' => 'classic_law_firm_sanitize_choices',
	));

	$wp_customize->add_control('classic_law_firm_slider_cat', array(
	    'type'    => 'select',
	    'choices' => $classic_law_firm_cat_post,
	    'label'   => __('Select Category to display Latest Post', 'classic-law-firm'),
	    'description' => __('<p class="sec-title">Choose a category, then reload the page.</p>', 'classic-law-firm'),
	    'section' => 'classic_law_firm_slider_section',
	));

	$wp_customize->add_setting('classic_law_firm_slider_small_title', array(
	    'default'           => '',
	    'sanitize_callback' => 'sanitize_text_field',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('classic_law_firm_slider_small_title', array(
	    'settings' => 'classic_law_firm_slider_small_title',
	    'section'  => 'classic_law_firm_slider_section',
	    'label'    => __('Add Slider Small Title', 'classic-law-firm'),
	    'type'     => 'text',
	));

	$wp_customize->add_setting('classic_law_firm_button_text',array(
		'default' => 'Our Best Services',
		'sanitize_callback' => 'sanitize_text_field',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_button_text', array(
	   'settings' => 'classic_law_firm_button_text',
	   'section'   => 'classic_law_firm_slider_section',
	   'label' => __('Add Button Text', 'classic-law-firm'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting('classic_law_firm_button_link_slider',array(
        'default'=> '',
        'sanitize_callback' => 'esc_url_raw'
    ));
    $wp_customize->add_control('classic_law_firm_button_link_slider',array(
        'label' => esc_html__('Add Button Link','classic-law-firm'),
        'section'=> 'classic_law_firm_slider_section',
        'type'=> 'url'
    ));

	$wp_customize->add_setting( 'classic_law_firm_slider_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_slider_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_LAW_FIRM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_law_firm_slider_section'
	));

	// Our Lawyers Section
	$wp_customize->add_section('classic_law_firm_lawyer_section', array(
	    'title'       => __('Manage Our Lawyers Section', 'classic-law-firm'),
	    'description' => __('<p class="sec-title">Manage Our Lawyers Section</p>', 'classic-law-firm'),
	    'priority'    => null,
	    'panel'       => 'classic_law_firm_panel_area',
	));

	$wp_customize->add_setting('classic_law_firm_disabled_lawyer_section', array(
	    'default'           => true,
	    'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('classic_law_firm_disabled_lawyer_section', array(
	    'settings' => 'classic_law_firm_disabled_lawyer_section',
	    'section'  => 'classic_law_firm_lawyer_section',
	    'label'    => __('Check To Enable Section', 'classic-law-firm'),
	    'type'     => 'checkbox',
	));

	$wp_customize->add_setting('classic_law_firm_lawyer_text', array(
	    'default'           => '',
	    'sanitize_callback' => 'sanitize_text_field',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('classic_law_firm_lawyer_text', array(
	    'settings' => 'classic_law_firm_lawyer_text',
	    'section'  => 'classic_law_firm_lawyer_section',
	    'label'    => __('Add Our Lawyers Text', 'classic-law-firm'),
	    'type'     => 'text',
	));

	$wp_customize->add_setting('classic_law_firm_lawyer_title', array(
	    'default'           => '',
	    'sanitize_callback' => 'sanitize_text_field',
	    'capability'        => 'edit_theme_options',
	));
	$wp_customize->add_control('classic_law_firm_lawyer_title', array(
	    'settings' => 'classic_law_firm_lawyer_title',
	    'section'  => 'classic_law_firm_lawyer_section',
	    'label'    => __('Add Our Lawyers Title', 'classic-law-firm'),
	    'type'     => 'text',
	));

	for ($classic_law_firm_i = 1; $classic_law_firm_i <= 3; $classic_law_firm_i++) {
		$wp_customize->add_setting('classic_law_firm_lawyer_img'.$classic_law_firm_i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'esc_url_raw',
		));
		$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'classic_law_firm_lawyer_img'.$classic_law_firm_i,array(
		    'label' => __('Select Lawyer Image','classic-law-firm'),
		    'description'	=> __('Use the given image dimension (365px x 335px).','classic-law-firm'),
		    'section' => 'classic_law_firm_lawyer_section'
		)));

		$wp_customize->add_setting('classic_law_firm_lawyer_name'.$classic_law_firm_i, array(
		    'default'           => '',
		    'sanitize_callback' => 'sanitize_text_field',
		    'capability'        => 'edit_theme_options',
		));
		$wp_customize->add_control('classic_law_firm_lawyer_name'.$classic_law_firm_i, array(
		    'settings' => 'classic_law_firm_lawyer_name'.$classic_law_firm_i,
		    'section'  => 'classic_law_firm_lawyer_section',
		    'label'    => __('Add Lawyer Name', 'classic-law-firm'),
		    'type'     => 'text',
		));

		$wp_customize->add_setting('classic_law_firm_lawyer_name_url'.$classic_law_firm_i,array(
			'default' => '',
			'sanitize_callback' => 'esc_url_raw',
			'capability' => 'edit_theme_options',
		));
		$wp_customize->add_control( 'classic_law_firm_lawyer_name_url'.$classic_law_firm_i, array(
		   'settings' => 'classic_law_firm_lawyer_name_url'.$classic_law_firm_i,
		   'section'   => 'classic_law_firm_lawyer_section',
		   'label' => __('Add Link', 'classic-law-firm'),
		   'type'      => 'url'
		));

		$wp_customize->add_setting('classic_law_firm_lawyer_category'.$classic_law_firm_i, array(
		    'default'           => '',
		    'sanitize_callback' => 'sanitize_text_field',
		    'capability'        => 'edit_theme_options',
		));
		$wp_customize->add_control('classic_law_firm_lawyer_category'.$classic_law_firm_i, array(
		    'settings' => 'classic_law_firm_lawyer_category'.$classic_law_firm_i,
		    'section'  => 'classic_law_firm_lawyer_section',
		    'label'    => __('Add Designation', 'classic-law-firm'),
		    'type'     => 'text',
		));
	}

	$wp_customize->add_setting( 'classic_law_firm_lawyer_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_lawyer_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_LAW_FIRM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_law_firm_lawyer_section'
	));

	//Blog post
	$wp_customize->add_section('classic_law_firm_blog_post_settings',array(
        'title' => __('Manage Post Section', 'classic-law-firm'),
        'priority' => null,
        'panel' => 'classic_law_firm_panel_area'
    ) );

	// Layouts Post
	$wp_customize->add_setting(
		'classic_law_firm_blog_layout_option_setting',
		array(
			'default'           => 'Left',
			'sanitize_callback' => 'classic_law_firm_sanitize_choices',
		)
	);

	$wp_customize->add_control(
		new Classic_Law_Firm_Image_Radio_Control(
			$wp_customize,
			'classic_law_firm_blog_layout_option_setting',
			array(
				'label'   => __( 'Post Layouts', 'classic-law-firm' ),
				'section' => 'classic_law_firm_blog_post_settings',
				'choices' => array(
					'Left' => get_template_directory_uri() . '/images/layout-1.png',
					'Center'    => get_template_directory_uri() . '/images/layout-2.png',
					'Right'   => get_template_directory_uri() . '/images/layout-3.png',
				),
			)
		)
	);

	$wp_customize->add_setting('classic_law_firm_metafields_date', array(
	    'default' => true,
	    'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('classic_law_firm_metafields_date', array(
	    'settings' => 'classic_law_firm_metafields_date', 
	    'section'   => 'classic_law_firm_blog_post_settings',
	    'label'     => __('Check to Enable Date', 'classic-law-firm'),
	    'type'      => 'checkbox',
	));

	$wp_customize->add_setting('classic_law_firm_metafields_comments', array(
		'default' => true,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
	));	
	$wp_customize->add_control('classic_law_firm_metafields_comments', array(
		'settings' => 'classic_law_firm_metafields_comments',
		'section'  => 'classic_law_firm_blog_post_settings',
		'label'    => __('Check to Enable Comments', 'classic-law-firm'),
		'type'     => 'checkbox',
	));

	$wp_customize->add_setting('classic_law_firm_metafields_author', array(
		'default' => true,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('classic_law_firm_metafields_author', array(
		'settings' => 'classic_law_firm_metafields_author',
		'section'  => 'classic_law_firm_blog_post_settings',
		'label'    => __('Check to Enable Author', 'classic-law-firm'),
		'type'     => 'checkbox',
	));		

	$wp_customize->add_setting('classic_law_firm_metafields_time', array(
		'default' => true,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('classic_law_firm_metafields_time', array(
		'settings' => 'classic_law_firm_metafields_time',
		'section'  => 'classic_law_firm_blog_post_settings',
		'label'    => __('Check to Enable Time', 'classic-law-firm'),
		'type'     => 'checkbox',
	));	

	$wp_customize->add_setting('classic_law_firm_metabox_seperator',array(
		'default' => '|',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_metabox_seperator',array(
		'type' => 'text',
		'label' => __('Metabox Seperator','classic-law-firm'),
		'description' => __('Ex: "/", "|", "-", ...','classic-law-firm'),
		'section' => 'classic_law_firm_blog_post_settings'
	));

    // Add Settings and Controls for Post Layout
	$wp_customize->add_setting('classic_law_firm_sidebar_post_layout',array(
		'default' => 'right',
		'sanitize_callback' => 'classic_law_firm_sanitize_choices'
	));
	$wp_customize->add_control('classic_law_firm_sidebar_post_layout',array(
		'type' => 'radio',
		'label'     => __('Theme Post Sidebar Position', 'classic-law-firm'),
		'description'   => __('This option work for blog page, archive page and search page.', 'classic-law-firm'),
		'section' => 'classic_law_firm_blog_post_settings',
		'choices' => array(
			'left' => __('Left','classic-law-firm'),
			'right' => __('Right','classic-law-firm'),
			'three-column' => __('Three Columns','classic-law-firm'),
			'four-column' => __('Four Columns','classic-law-firm'),
			'grid' => __('Grid Layout','classic-law-firm'),
			'full' => __('No Sidebar','classic-law-firm')
     ),
	) );

	$wp_customize->add_setting('classic_law_firm_blog_post_description_option',array(
    	'default'   => 'Excerpt Content', 
        'sanitize_callback' => 'classic_law_firm_sanitize_choices'
	));
	$wp_customize->add_control('classic_law_firm_blog_post_description_option',array(
        'type' => 'radio',
        'label' => __('Post Description Length','classic-law-firm'),
        'section' => 'classic_law_firm_blog_post_settings',
        'choices' => array(
            'No Content' => __('No Content','classic-law-firm'),
            'Excerpt Content' => __('Excerpt Content','classic-law-firm'),
            'Full Content' => __('Full Content','classic-law-firm'),
        ),
	) );

	$wp_customize->add_setting('classic_law_firm_blog_post_thumb',array(
        'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
        'default'           => 1,
    ));
    $wp_customize->add_control('classic_law_firm_blog_post_thumb',array(
        'type'        => 'checkbox',
        'label'       => esc_html__('Show / Hide Blog Post Thumbnail', 'classic-law-firm'),
        'section'     => 'classic_law_firm_blog_post_settings',
    ));

	$wp_customize->add_setting( 'classic_law_firm_blog_post_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_blog_post_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_LAW_FIRM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_law_firm_blog_post_settings'
	));

	//Single Post Settings
	$wp_customize->add_section('classic_law_firm_single_post_settings',array(
		'title' => __('Manage Single Post Section', 'classic-law-firm'),
		'priority' => null,
		'panel' => 'classic_law_firm_panel_area'
	));

	$wp_customize->add_setting('classic_law_firm_single_post_date',array(
		'default' => true,
		'sanitize_callback'	=> 'classic_law_firm_sanitize_checkbox'
	));
	$wp_customize->add_control('classic_law_firm_single_post_date',array(
		'type' => 'checkbox',
		'label' => __('Enable / Disable Date ','classic-law-firm'),
		'section' => 'classic_law_firm_single_post_settings'
	));	

	$wp_customize->add_setting('classic_law_firm_single_post_author',array(
		'default' => true,
		'sanitize_callback'	=> 'classic_law_firm_sanitize_checkbox'
	));
	$wp_customize->add_control('classic_law_firm_single_post_author',array(
		'type' => 'checkbox',
		'label' => __('Enable / Disable Author','classic-law-firm'),
		'section' => 'classic_law_firm_single_post_settings'
	));

	$wp_customize->add_setting('classic_law_firm_single_post_comment',array(
		'default' => true,
		'sanitize_callback'	=> 'classic_law_firm_sanitize_checkbox'
	));
	$wp_customize->add_control('classic_law_firm_single_post_comment',array(
		'type' => 'checkbox',
		'label' => __('Enable / Disable Comments','classic-law-firm'),
		'section' => 'classic_law_firm_single_post_settings'
	));	

	$wp_customize->add_setting('classic_law_firm_single_post_time',array(
		'default' => true,
		'sanitize_callback'	=> 'classic_law_firm_sanitize_checkbox'
	));
	$wp_customize->add_control('classic_law_firm_single_post_time',array(
		'type' => 'checkbox',
		'label' => __('Enable / Disable Time','classic-law-firm'),
		'section' => 'classic_law_firm_single_post_settings'
	));	

	$wp_customize->add_setting('classic_law_firm_single_post_metabox_seperator',array(
		'default' => '|',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_single_post_metabox_seperator',array(
		'type' => 'text',
		'label' => __('Metabox Seperator','classic-law-firm'),
		'description' => __('Ex: "/", "|", "-", ...','classic-law-firm'),
		'section' => 'classic_law_firm_single_post_settings'
	)); 

	$wp_customize->add_setting('classic_law_firm_sidebar_single_post_layout',array(
    	'default' => 'right',
    	 'sanitize_callback' => 'classic_law_firm_sanitize_choices'
	));
	$wp_customize->add_control('classic_law_firm_sidebar_single_post_layout',array(
   		'type' => 'radio',
    	'label'     => __('Single post sidebar layout', 'classic-law-firm'),
     	'section' => 'classic_law_firm_single_post_settings',
     	'choices' => array(
			'left' => __('Left','classic-law-firm'),
			'right' => __('Right','classic-law-firm'),
			'full' => __('No Sidebar','classic-law-firm')
     ),
	));

	$wp_customize->add_setting( 'classic_law_firm_single_post_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_single_post_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_LAW_FIRM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_law_firm_single_post_settings'
	)); 

	//Page Settings
	$wp_customize->add_section('classic_law_firm_page_settings',array(
		'title' => __('Manage Page Section', 'classic-law-firm'),
		'priority' => null,
		'panel' => 'classic_law_firm_panel_area'
	));

	// Add Settings and Controls for Page Layout
	$wp_customize->add_setting('classic_law_firm_sidebar_page_layout',array(
		'default' => 'full',
			'sanitize_callback' => 'classic_law_firm_sanitize_choices'
	));
	$wp_customize->add_control('classic_law_firm_sidebar_page_layout',array(
		'type' => 'radio',
		'label'     => __('Theme Page Sidebar Position', 'classic-law-firm'),
		'section' => 'classic_law_firm_page_settings',
		'choices' => array(
			'left' => __('Left','classic-law-firm'),
			'right' => __('Right','classic-law-firm'),
			'full' => __('No Sidebar','classic-law-firm')
	),
	));	

	$wp_customize->add_setting( 'classic_law_firm_page_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_page_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		<a target='_blank' href='". esc_url(CLASSIC_LAW_FIRM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_law_firm_page_settings'
	));

	// 404 Page Settings
	$wp_customize->add_section('classic_law_firm_page_not_found', array(
		'title'	=> __('Manage 404 Page Section','classic-law-firm'),
		'priority'	=> null,
		'panel' => 'classic_law_firm_panel_area',
	));
	
	$wp_customize->add_setting('classic_law_firm_page_not_found_heading',array(
		'default'=> __('404 Not Found','classic-law-firm'),
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_page_not_found_heading',array(
		'label'	=> __('404 Heading','classic-law-firm'),
		'section'=> 'classic_law_firm_page_not_found',
		'type'=> 'text'
	));

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

	$wp_customize->add_control('classic_law_firm_page_not_found_content',array(
		'label'	=> __('404 Text','classic-law-firm'),
		'input_attrs' => array(
			'placeholder' => __( 'Looks like you have taken a wrong turn.....Don\'t worry... it happens to the best of us.', 'classic-law-firm' ),
		),
		'section'=> 'classic_law_firm_page_not_found',
		'type'=> 'text'
	));

	$wp_customize->add_setting('classic_law_firm_page_not_found_btn',array(
		'default' => 'Homepage',
		'sanitize_callback' => 'sanitize_text_field',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_page_not_found_btn', array(
	   'settings' => 'classic_law_firm_page_not_found_btn',
	   'section'   => 'classic_law_firm_page_not_found',
	   'label' => __('404 Button', 'classic-law-firm'),
	   'type'      => 'text'
	));

	$wp_customize->add_setting( 'classic_law_firm_page_not_found_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_page_not_found_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
			<a target='_blank' href='". esc_url(CLASSIC_LAW_FIRM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_law_firm_page_not_found'
	));

	// No Results Page Settings
	$wp_customize->add_section('classic_law_firm_no_results_found', array(
		'title'	=> __('Manage No Results Page Section','classic-law-firm'),
		'priority'	=> null,
		'panel' => 'classic_law_firm_panel_area',
	));
	
	$wp_customize->add_setting('classic_law_firm_page_nothing_found_heading',array(
		'default'=> __('Nothing Found','classic-law-firm'),
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_page_nothing_found_heading',array(
		'label'	=> __('Add Title','classic-law-firm'),
		'section'=> 'classic_law_firm_no_results_found',
		'type'=> 'text'
	));

	$wp_customize->add_setting('classic_law_firm_nothing_found_content',array(
		'default'=> 'Sorry, but nothing matched your search terms. Please try again with some different keywords.',
		'sanitize_callback'	=> 'sanitize_text_field'
	));

	$wp_customize->add_control('classic_law_firm_nothing_found_content',array(
		'label'	=> __('Add Text','classic-law-firm'),
		'section'=> 'classic_law_firm_no_results_found',
		'type'=> 'text'
	));

	$wp_customize->add_setting('classic_law_firm_nothing_found_search',array(
		'default' => true,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_nothing_found_search', array(
	   'settings' => 'classic_law_firm_nothing_found_search',
	   'section'   => 'classic_law_firm_no_results_found',
	   'label'     => __('Check To Enable Search','classic-law-firm'),
	   'type'      => 'checkbox'
	));

	$wp_customize->add_setting( 'classic_law_firm_no_results_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_no_results_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		<a target='_blank' href='". esc_url(CLASSIC_LAW_FIRM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_law_firm_no_results_found'
	));

	// Animation Section
	$wp_customize->add_section('classic_law_firm_animation', array(
		'title'	=> __('Manage Animation Section','classic-law-firm'),
		'description'	=> __('<p class="sec-title">Manage Animation Section</p>','classic-law-firm'),
		'priority'	=> null,
		'panel' => 'classic_law_firm_panel_area',
	));

	$wp_customize->add_setting('classic_law_firm_animation_enabled',array(
		'default' => true,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_animation_enabled', array(
	   'settings' => 'classic_law_firm_animation_enabled',
	   'section'   => 'classic_law_firm_animation',
	   'label'     => __('Check To Enable Animation','classic-law-firm'),
	   'type'      => 'checkbox'
	));

	$wp_customize->add_setting( 'classic_law_firm_animation_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_animation_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		<a target='_blank' href='". esc_url(CLASSIC_LAW_FIRM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_law_firm_animation'
	));
    
	// Footer Section
	$wp_customize->add_section('classic_law_firm_footer', array(
		'title'	=> __('Manage Footer Section','classic-law-firm'),
		'description'	=> __('<p class="sec-title">Manage Footer Section</p>','classic-law-firm'),
		'priority'	=> null,
		'panel' => 'classic_law_firm_panel_area',
	));

	$wp_customize->add_setting('classic_law_firm_footer_widget', array(
	    'default' => true,
	    'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
	));
	$wp_customize->add_control('classic_law_firm_footer_widget', array(
	    'settings' => 'classic_law_firm_footer_widget',
	    'section'   => 'classic_law_firm_footer',
	    'label'     => __('Check to Enable Footer Widget', 'classic-law-firm'),
	    'type'      => 'checkbox',
	));

	//  footer bg color
	$wp_customize->add_setting('classic_law_firm_footerbg_color',array(
		'default' => '',
		'sanitize_callback' => 'classic_law_firm_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_footerbg_color', array(
		'settings' => 'classic_law_firm_footerbg_color',
		'section'   => 'classic_law_firm_footer',
		'label' => __('Footer Background Color', 'classic-law-firm'),
		'type'      => 'color'
	));

	$wp_customize->add_setting('classic_law_firm_footer_bg_image',array(
        'default'   => '',
        'sanitize_callback' => 'esc_url_raw',
    ));
    $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'classic_law_firm_footer_bg_image',array(
        'label' => __('Footer Background Image','classic-law-firm'),
        'section' => 'classic_law_firm_footer',
    )));

	$wp_customize->add_setting('classic_law_firm_footer_img_position',array(
		'default' => 'center center',
		'transport' => 'refresh',
		'sanitize_callback' => 'classic_law_firm_sanitize_choices'
	));
	$wp_customize->add_control('classic_law_firm_footer_img_position',array(
		'type' => 'select',
		'label' => __('Footer Image Position','classic-law-firm'),
		'section' => 'classic_law_firm_footer',
		'choices' 	=> array(
			'center center'   => esc_html__( 'Center', 'classic-law-firm' ),
			'center top'   => esc_html__( 'Top', 'classic-law-firm' ),
			'left center'   => esc_html__( 'Left', 'classic-law-firm' ),
			'right center'   => esc_html__( 'Right', 'classic-law-firm' ),
			'center bottom'   => esc_html__( 'Bottom', 'classic-law-firm' ),
		),
	));	

	$wp_customize->add_setting('classic_law_firm_copyright_line',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field',
	));
	$wp_customize->add_control( 'classic_law_firm_copyright_line', array(
	   'section' 	=> 'classic_law_firm_footer',
	   'label'	 	=> __('Copyright Line','classic-law-firm'),
	   'type'    	=> 'text',
	   'priority' 	=> null,
    ));

	$wp_customize->add_setting('classic_law_firm_copyright_link',array(
    	'default' => '',
		'sanitize_callback' => 'sanitize_text_field',
	));
	$wp_customize->add_control( 'classic_law_firm_copyright_link', array(
	   'section' 	=> 'classic_law_firm_footer',
	   'label'	 	=> __('Copyright Link','classic-law-firm'),
	   'type'    	=> 'text',
	   'priority' 	=> null,
    ));

	//  footer title color
	$wp_customize->add_setting('classic_law_firm_footertitle_color',array(
		'default' => '',
		'sanitize_callback' => 'classic_law_firm_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_footertitle_color', array(
	   'settings' => 'classic_law_firm_footertitle_color',
	   'section'   => 'classic_law_firm_footer',
	   'label' => __('Title Color', 'classic-law-firm'),
	   'type'      => 'color'
	));

	//  footer list color
	$wp_customize->add_setting('classic_law_firm_footerlist_color',array(
		'default' => '',
		'sanitize_callback' => 'classic_law_firm_sanitize_hex_color',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_footerlist_color', array(
	   'settings' => 'classic_law_firm_footerlist_color',
	   'section'   => 'classic_law_firm_footer',
	   'label' => __('List Color', 'classic-law-firm'),
	   'type'      => 'color'
	));

	$wp_customize->add_setting('classic_law_firm_scroll_hide', array(
        'default' => true,
        'sanitize_callback' => 'classic_law_firm_sanitize_checkbox'
    ));
    $wp_customize->add_control( new WP_Customize_Control($wp_customize,'classic_law_firm_scroll_hide',array(
        'label'          => __( 'Check To Show Scroll To Top', 'classic-law-firm' ),
        'section'        => 'classic_law_firm_footer',
        'settings'       => 'classic_law_firm_scroll_hide',
        'type'           => 'checkbox',
    )));

	$wp_customize->add_setting('classic_law_firm_scroll_position',array(
        'default' => 'Right',
        'sanitize_callback' => 'classic_law_firm_sanitize_choices'
    ));
    $wp_customize->add_control('classic_law_firm_scroll_position',array(
        'type' => 'radio',
        'section' => 'classic_law_firm_footer',
        'label'	 	=> __('Scroll To Top Positions','classic-law-firm'),
        'choices' => array(
            'Right' => __('Right','classic-law-firm'),
            'Left' => __('Left','classic-law-firm'),
            'Center' => __('Center','classic-law-firm')
        ),
    ));

	$wp_customize->add_setting('classic_law_firm_scroll_text',array(
		'default'	=> __('TOP','classic-law-firm'),
		'sanitize_callback'	=> 'sanitize_text_field',
	));	
	$wp_customize->add_control('classic_law_firm_scroll_text',array(
		'label'	=> __('Scroll To Top Button Text','classic-law-firm'),
		'section'	=> 'classic_law_firm_footer',
		'type'		=> 'text'
	));

	$wp_customize->add_setting( 'classic_law_firm_scroll_top_shape', array(
		'default'           => 'circle',
		'sanitize_callback' => 'sanitize_text_field',
	));
	$wp_customize->add_control( 'classic_law_firm_scroll_top_shape', array(
		'label'    => __( 'Scroll to Top Button Shape', 'classic-law-firm' ),
		'section'  => 'classic_law_firm_footer',
		'settings' => 'classic_law_firm_scroll_top_shape',
		'type'     => 'radio',
		'choices'  => array(
			'box'        => __( 'Box', 'classic-law-firm' ),
			'curved' => __( 'Curved', 'classic-law-firm'),
			'circle'     => __( 'Circle', 'classic-law-firm' ),
		),
	));

	$wp_customize->add_setting('classic_law_firm_footer_widget_areas',array(
		'default'           => 4,
		'sanitize_callback' => 'classic_law_firm_sanitize_choices',
	));
	$wp_customize->add_control('classic_law_firm_footer_widget_areas',array(
		'type'        => 'radio',
		'section' => 'classic_law_firm_footer',
		'label'       => __('Footer widget area', 'classic-law-firm'),
		'choices' => array(
		   '1'     => __('One', 'classic-law-firm'),
		   '2'     => __('Two', 'classic-law-firm'),
		   '3'     => __('Three', 'classic-law-firm'),
		   '4'     => __('Four', 'classic-law-firm')
		),
	));
    // Progress Bar
	$wp_customize->add_setting('classic_law_firm_progress_bar', array(
		'default' => false,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
	));

	$wp_customize->add_control(
		new WP_Customize_Control(
			$wp_customize,
			'classic_law_firm_progress_bar',
			array(
				'label' => __('Check To Show Progress Bar', 'classic-law-firm'),
				'section' => 'classic_law_firm_footer',
				'settings' => 'classic_law_firm_progress_bar',
				'type' => 'checkbox',
			)
		)
	);
    // Sticky Copyright Enable / Disable
	$wp_customize->add_setting('classic_law_firm_sticky_copyright_enable',array(
		'default' => false,
		'sanitize_callback' => 'classic_law_firm_sanitize_checkbox',
	));
	$wp_customize->add_control( 'classic_law_firm_sticky_copyright_enable', array(
	   'section'   => 'classic_law_firm_footer',
	   'label'	=> __('Check To Show Sticky Copyright','classic-law-firm'),
	   'type'      => 'checkbox'
 	));
	$wp_customize->add_setting( 'classic_law_firm_footer_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_footer_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_LAW_FIRM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_law_firm_footer'
	));

	// Footer Social Section
	$wp_customize->add_section('classic_law_firm_footer_social_icons', array(
		'title'	=> __('Manage Footer Social Section','classic-law-firm'),
		'description'	=> __('<p class="sec-title">Manage Footer Social Section</p>','classic-law-firm'),
		'priority'	=> null,
		'panel' => 'classic_law_firm_panel_area',
	));

	$wp_customize->add_setting('classic_law_firm_footer_facebook_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_footer_facebook_link', array(
	   'settings' => 'classic_law_firm_footer_facebook_link',
	   'section'   => 'classic_law_firm_footer_social_icons',
	   'label' => __('Facebook Link', 'classic-law-firm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_law_firm_footer_youtube_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_footer_youtube_link', array(
	   'settings' => 'classic_law_firm_footer_youtube_link',
	   'section'   => 'classic_law_firm_footer_social_icons',
	   'label' => __('Youtube Link', 'classic-law-firm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_law_firm_footer_instagram_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_footer_instagram_link', array(
	   'settings' => 'classic_law_firm_footer_instagram_link',
	   'section'   => 'classic_law_firm_footer_social_icons',
	   'label' => __('Facebook Link', 'classic-law-firm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_law_firm_footer_linkedin_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_footer_linkedin_link', array(
	   'settings' => 'classic_law_firm_footer_linkedin_link',
	   'section'   => 'classic_law_firm_footer_social_icons',
	   'label' => __('Linkedin Link', 'classic-law-firm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting('classic_law_firm_footer_twitter_link',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw',
		'capability' => 'edit_theme_options',
	));
	$wp_customize->add_control( 'classic_law_firm_footer_twitter_link', array(
	   'settings' => 'classic_law_firm_footer_twitter_link',
	   'section'   => 'classic_law_firm_footer_social_icons',
	   'label' => __('Twitter Link', 'classic-law-firm'),
	   'type'      => 'url'
	));

	$wp_customize->add_setting( 'classic_law_firm_footer_social_settings_upgraded_features',array(
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('classic_law_firm_footer_social_settings_upgraded_features', array(
		'type'=> 'hidden',
		'description' => "<span class='customizer-upgraded-features'>Unlock Premium Customization Features:
		   <a target='_blank' href='". esc_url(CLASSIC_LAW_FIRM_PREMIUM_PAGE) ." '>Upgrade to Pro</a></span>",
		'section' => 'classic_law_firm_footer_social_icons'
	));
    
	// Google Fonts
	$wp_customize->add_section( 'classic_law_firm_google_fonts_section', array(
		'title'       => __( 'Google Fonts', 'classic-law-firm' ),
		'priority'    => 24,
	) );

	$font_choices = array(
		'' => 'No Fonts',
		'Kaushan Script:' => 'Kaushan Script',
		'Emilys Candy:' => 'Emilys Candy',
		'Poppins:0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900' => 'Poppins',
		'Source Sans Pro:400,700,400italic,700italic' => 'Source Sans Pro',
		'Open Sans:400italic,700italic,400,700' => 'Open Sans',
		'Oswald:400,700' => 'Oswald',
		'Playfair Display:400,700,400italic' => 'Playfair Display',
		'Montserrat:400,700' => 'Montserrat',
		'Raleway:400,700' => 'Raleway',
		'Droid Sans:400,700' => 'Droid Sans',
		'Lato:400,700,400italic,700italic' => 'Lato',
		'Arvo:400,700,400italic,700italic' => 'Arvo',
		'Lora:400,700,400italic,700italic' => 'Lora',
		'Merriweather:400,300italic,300,400italic,700,700italic' => 'Merriweather',
		'Oxygen:400,300,700' => 'Oxygen',
		'PT Serif:400,700' => 'PT Serif',
		'PT Sans:400,700,400italic,700italic' => 'PT Sans',
		'PT Sans Narrow:400,700' => 'PT Sans Narrow',
		'Cabin:400,700,400italic' => 'Cabin',
		'Fjalla One:400' => 'Fjalla One',
		'Francois One:400' => 'Francois One',
		'Josefin Sans:400,300,600,700' => 'Josefin Sans',
		'Libre Baskerville:400,400italic,700' => 'Libre Baskerville',
		'Arimo:400,700,400italic,700italic' => 'Arimo',
		'Ubuntu:400,700,400italic,700italic' => 'Ubuntu',
		'Bitter:400,700,400italic' => 'Bitter',
		'Droid Serif:400,700,400italic,700italic' => 'Droid Serif',
		'Roboto:400,400italic,700,700italic' => 'Roboto',
		'Open Sans Condensed:700,300italic,300' => 'Open Sans Condensed',
		'Roboto Condensed:400italic,700italic,400,700' => 'Roboto Condensed',
		'Roboto Slab:400,700' => 'Roboto Slab',
		'Yanone Kaffeesatz:400,700' => 'Yanone Kaffeesatz',
		'Rokkitt:400' => 'Rokkitt',
	);

	$wp_customize->add_setting( 'classic_law_firm_headings_fonts', array(
		'sanitize_callback' => 'classic_law_firm_sanitize_fonts',
	));
	$wp_customize->add_control( 'classic_law_firm_headings_fonts', array(
		'type' => 'select',
		'description' => __('Select your desired font for the headings.', 'classic-law-firm'),
		'section' => 'classic_law_firm_google_fonts_section',
		'choices' => $font_choices
	));

	$wp_customize->add_setting( 'classic_law_firm_body_fonts', array(
		'sanitize_callback' => 'classic_law_firm_sanitize_fonts'
	));
	$wp_customize->add_control( 'classic_law_firm_body_fonts', array(
		'type' => 'select',
		'description' => __( 'Select your desired font for the body.', 'classic-law-firm' ),
		'section' => 'classic_law_firm_google_fonts_section',
		'choices' => $font_choices
	));
  
}
add_action( 'customize_register', 'classic_law_firm_customize_register' );

/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 */
function classic_law_firm_customize_preview_js() {
	wp_enqueue_script( 'classic_law_firm_customizer', esc_url(get_template_directory_uri()) . '/js/customize-preview.js', array( 'customize-preview' ), '20161510', true );
}
add_action( 'customize_preview_init', 'classic_law_firm_customize_preview_js' );
