<?php
/**
 * Theme Customizer Controls
 *
 * @package Corporate Businessmen
 */

if ( ! function_exists( 'corporate_businessmen_customizer_footer_register' ) ) :
function corporate_businessmen_customizer_footer_register( $wp_customize ) {
 	
 	$wp_customize->add_section(
        'corporate_businessmen_footer_settings',
        array (
            'priority'      => 30,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Footer Settings', 'corporate-businessmen' )
        )
    );

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

	$wp_customize->add_control( 
		new Corporate_Businessmen_Title_Info_Control( $wp_customize, 'corporate_businessmen_label_footer_settings_title', 
		array(
		    'label'       => esc_html__( 'Footer Settings', 'corporate-businessmen' ),
		    'section'     => 'corporate_businessmen_footer_settings',
		    'type'        => 'corporate-businessmen-title',
		    'settings'    => 'corporate_businessmen_label_footer_settings_title',
		) 
	));

	// Copyright text
    $wp_customize->add_setting(
        'corporate_businessmen_footer_copyright_text',
        array(
            'type' => 'theme_mod',
            'sanitize_callback' => 'corporate_businessmen_sanitize_textarea_field'
        )
    );

    $wp_customize->add_control(
        'corporate_businessmen_footer_copyright_text',
        array(
            'settings'      => 'corporate_businessmen_footer_copyright_text',
            'section'       => 'corporate_businessmen_footer_settings',
            'type'          => 'textarea',
            'label'         => esc_html__( 'Footer Copyright Text', 'corporate-businessmen' )
        )
    );
}
endif;

add_action( 'customize_register', 'corporate_businessmen_customizer_footer_register' );