<?php
/**
 * ST Golf Theme Customizer.
 */

if ( ! function_exists( 'st_golf_footer_text_default' ) ) {
	/**
	 * Default footer credit text.
	 */
	function st_golf_footer_text_default() {
		return __( 'ST Golf Theme by <a href="https://striviothemes.com/">Strivio Themes</a>.', 'st-golf' );
	}
}

/**
 * Register Customizer settings and controls.
 */
function st_golf_customize_register( $wp_customize ) {

	// Footer section.
	$wp_customize->add_section( 'st_golf_footer_section', array(
		'title'    => esc_html__( 'Footer', 'st-golf' ),
		'priority' => 120,
	) );

	// Footer text setting.
	$wp_customize->add_setting( 'st_golf_footer_text', array(
		'default'           => st_golf_footer_text_default(),
		'sanitize_callback' => 'wp_kses_post',
		'transport'         => 'refresh',
	) );

	$wp_customize->add_control( 'st_golf_footer_text', array(
		'label'       => esc_html__( 'Footer Text', 'st-golf' ),
		'description' => esc_html__( 'Basic HTML allowed (e.g. links).', 'st-golf' ),
		'section'     => 'st_golf_footer_section',
		'type'        => 'textarea',
	) );
}
add_action( 'customize_register', 'st_golf_customize_register' );
