<?php
/**
 * Axvart Theme Settings
 *
 * This file handles the registration of theme settings with WordPress REST API
 * so they can be accessed and updated from the block editor.
 *
 * @package Axvart
 * @since 1.0.0
 */

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

/**
 * Register theme settings with REST API.
 *
 * Using register_setting() with show_in_rest => true exposes these options
 * on the /wp/v2/settings endpoint, which is what the block editor reads and
 * writes via apiFetch({ path: '/wp/v2/settings' }) and
 * getEntityRecord('root', 'site').
 */
function axvart_register_theme_settings() {
    register_setting( 'options', 'axvart_scroll_top', array(
        'type'         => 'boolean',
        'description'  => __( 'Enable or disable the scroll to top button', 'axvart' ),
        'show_in_rest' => true,
        'default'      => false,
    ) );

    register_setting( 'options', 'axvart_hover_effects', array(
        'type'         => 'boolean',
        'description'  => __( 'Enable or disable hover effects for interactive elements', 'axvart' ),
        'show_in_rest' => true,
        'default'      => true,
    ) );
}
add_action( 'init', 'axvart_register_theme_settings' );