<?php
/**
 * Adds fields for the Site Identity section within the Header Settings panel.
 * 
 * Provides options for configuring site identity settings such as site title and logo.
 *
 * @package Yaatra
 */

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

add_action( 'customize_register', 'yaatra_register_site_identity_options' );

if ( ! function_exists( 'yaatra_register_site_identity_options' ) ) :

    /**
	 * Registers theme options for the Site Identity section in the Customizer.
	 * 
	 * Adds and configures settings for site identity, such as site title and logo.
	 *
	 * @param WP_Customize_Manager $wp_customize The Customizer object managing theme options.
	 * @since 1.0.0
	 */
    function yaatra_register_site_identity_options( $wp_customize ) {

        /*
         * Failsafe is safe
         */
        if ( ! isset( $wp_customize ) ) {
            return;
        }

        /**
         * Tabs field for site style section
         *
         * Header Settings > Site Identity
         *
         * @since 1.0.0
         */
        $wp_customize->add_setting( 'yaatra_site_identity_tabs',
            array(
                'default'           => yaatra_get_customizer_default( 'yaatra_site_identity_tabs' ),
                'sanitize_callback' => 'sanitize_text_field',
            )
        );
        $wp_customize->add_control( new Yaatra_Control_Tabs(
            $wp_customize, 'yaatra_site_identity_tabs',
                array(
                    'priority'      => 5,
                    'section'       => 'title_tagline',
                    'settings'      => 'yaatra_site_identity_tabs',
                    'choices'       => yaatra_site_identity_tabs_choices()
                )
            )
        );

        

    }

endif;