<?php
/**
 * Adds fields for the Site Identity section in the Header Settings panel.
 * 
 * @package Blogbuster
 */

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

add_action( 'customize_register', 'blogbuster_register_site_identity_options' );

if ( ! function_exists( 'blogbuster_register_site_identity_options' ) ) :

    /**
     * Register theme options for Site Identity section.
     * 
     * @param WP_Customize_Manager $wp_customize Object that holds the customizer data.
     * @since 1.0.0
     */
    function blogbuster_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( 'blogbuster_site_identity_tabs',
            array(
                'default'           => blogbuster_get_customizer_default( 'blogbuster_site_identity_tabs' ),
                'sanitize_callback' => 'sanitize_text_field',
            )
        );
        $wp_customize->add_control( new blogbuster_Control_Tabs(
            $wp_customize, 'blogbuster_site_identity_tabs',
                array(
                    'priority'      => 5,
                    'section'       => 'title_tagline',
                    'settings'      => 'blogbuster_site_identity_tabs',
                    'choices'       => array(
                        'general'   => array(
                            'title'     => __( 'General', 'blogbuster' ),
                            'fields'    => array(
                                'custom_logo',
                                'blogname',
                                'blogdescription',
                                'display_header_text',
                                'site_icon',

                            )
                        ),
                        'design'    => array(
                            'title' => __( 'Design', 'blogbuster' ),
                            'fields'    => array(
                                'header_textcolor'
                            )
                        )
                    )
                )
            )
        );

        

    }

endif;
