<?php
/**
 * Theme Customizer Controls
 *
 * @package Legacy Wellness Coach
 */

if ( ! function_exists( 'legacy_wellness_coach_customizer_footer_register' ) ) :
function legacy_wellness_coach_customizer_footer_register( $wp_customize ) {
 	
 	$wp_customize->add_section(
        'legacy_wellness_coach_footer_settings',
        array (
            'priority'      => 30,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Footer Settings', 'legacy-wellness-coach' )
        )
    );

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

	$wp_customize->add_control( 
		new Legacy_Wellness_Coach_Title_Info_Control( $wp_customize, 'legacy_wellness_coach_label_footer_settings_title', 
		array(
		    'label'       => esc_html__( 'Footer Settings', 'legacy-wellness-coach' ),
		    'section'     => 'legacy_wellness_coach_footer_settings',
		    'type'        => 'legacy-wellness-coach-title',
		    'settings'    => 'legacy_wellness_coach_label_footer_settings_title',
		) 
	));

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

    $wp_customize->add_control(
        'legacy_wellness_coach_footer_copyright_text',
        array(
            'settings'      => 'legacy_wellness_coach_footer_copyright_text',
            'section'       => 'legacy_wellness_coach_footer_settings',
            'type'          => 'textarea',
            'label'         => esc_html__( 'Footer Copyright Text', 'legacy-wellness-coach' )
        )
    );
}
endif;

add_action( 'customize_register', 'legacy_wellness_coach_customizer_footer_register' );