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

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

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

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

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

	$wp_customize->add_control( 'st_logistics_footer_text', array(
		'label'       => esc_html__( 'Footer Text', 'st-logistics' ),
		'description' => esc_html__( 'Basic HTML allowed (e.g. links).', 'st-logistics' ),
		'section'     => 'st_logistics_footer_section',
		'type'        => 'textarea',
	) );
}
add_action( 'customize_register', 'st_logistics_customize_register' );
