<?php
/**
 * Theme Customizer Controls
 *
 * @package somalite
 */


if ( ! function_exists( 'somalite_customizer_footer_register' ) ) :
function somalite_customizer_footer_register( $wp_customize ) {
     
    //Footer Settings
    $wp_customize->add_section(
        'soma_footer_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'theme_supports'=> '',
            'title'         => esc_html__( 'Footer Settings', 'somalite' )
        )
    );

    // Title label
    $wp_customize->add_setting( 
        'somalite_label_footer_settings', 
        array(
              'sanitize_callback' => 'somalite_sanitize_title',
        ) 
    );

    $wp_customize->add_control( 
        new Somalite_Title_Info_Control( $wp_customize, 'somalite_label_footer_settings', 
        array(
            'label'       => esc_html__( 'Footer Settings', 'somalite' ),
            'section'     => 'soma_footer_settings',
            'type'        => 'somalite-title',
            'settings'    => 'somalite_label_footer_settings',
        ) 
    ));

    // Copyright text
    $wp_customize->add_setting(
        'sm_copyright_text',
        array(
            'type' => 'theme_mod',
            'default'           => esc_html__( 'Copyrights 2017 Soma Lite. All Rights Reserved', 'somalite' ),
            'sanitize_callback' => 'somalite_sanitize_textarea_field'
        )
    );

    $wp_customize->add_control(
        'sm_copyright_text',
        array(
            'settings'      => 'sm_copyright_text',
            'section'       => 'soma_footer_settings',
            'type'          => 'textarea',
            'label'         => esc_html__( 'Footer copyright text', 'somalite' ),
            'description'   => esc_html__( 'Copyright text to be displayed in the footer. No HTML allowed.', 'somalite' )
        )
    );

}
endif;

add_action( 'customize_register', 'somalite_customizer_footer_register' );