<?php

//Add the Footer Section

	//Footer panel
	
	$wp_customize->add_panel( 'footer', array(
	'priority'    => 4,
	'title'       => esc_html( __( 'Footer', 'smerk' ) ),
	'description' => esc_html( __( 'Edit The Footer Section', 'smerk' ) ),
	'icon'        => 'dashicons-admin-site',
    ) );

	//Footer Section
    
    	

	$wp_customize->add_section( 'footer_copyright', array(
	'title'    => esc_html( __( 'Copyright', 'smerk' ) ),
	'panel'    => 'footer',
	'priority' => 261,
	'icon'     => 'dashicons-shield',
    ) );

	//Footer Settings
	
    $wp_customize->add_setting( 'ft_check' , array(
    'default'     => 'true',
	'transport' => 'refresh',
    'sanitize_callback' => 'smerk_sanitize_checkbox'
    ) );

	$wp_customize->add_setting( 'ft_cp_tt' , array(
    'default'     => '',
    'transport'   => 'postMessage',
	'sanitize_callback' => 'bookish_sanitize_textarea',
	 
    ) );
	
	$wp_customize->add_setting( 'ft_cp_text_color' , array(
    'default'     => '#FFFFF',
    'transport'   => 'refresh',
	'sanitize_callback' => 'smerk_sanitize_hexcolor'
    ) );
	
	
	//Footer Control

    $wp_customize->add_control('ft_check',
    array(
        'type' => 'checkbox',
        'label' => 'Copyright Text',
        'section' => 'footer_copyright',
		'settings' => 'ft_check'
    )
    );

	$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ft_cp_tt', array(
	'type'        => 'textarea',
	'label'        => __( 'Copyright Text', 'smerk' ),
	'help'      => esc_html( __( 'Enter the Copyright Text', 'smerk' ) ),
	'section'    => 'footer_copyright',
	'settings'   => 'ft_cp_tt',
    ) ) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_text_color', array(
	'label'        => __( 'Copyright Text Color', 'smerk' ),
	'help'      => esc_html( __( 'Setup Copyright Text color', 'smerk' ) ),
	'section'    => 'footer_copyright',
	'settings'   => 'ft_cp_text_color',
    ) ) );
	
	
	function bookish_sanitize_text( $str ) {
	return sanitize_text_field( $str );
    } 

    function bookish_sanitize_textarea( $text ) {
	return esc_textarea( $text );
    } 

    function bookish_sanitize_number( $int ) {
	return absint( $int );
    } 

    function bookish_sanitize_email( $email ) {
	if(is_email( $email )){
		return $email;
	}else{
		return '';
	  }
    } 
?>