Refactor(Admin): Implement Settings API & AJAX save for Settings Manager

- Refactored WPALLSTARS_Settings_Manager to use WordPress Settings API.
- Stores settings in single 'wpallstars_options' array.
- Implemented robust AJAX saving for specific settings (e.g., color scheme, auto-upload) via WPALLSTARS_Admin_Manager::update_option.
- Updated JS and setting render functions for AJAX.
- Corrected admin menu registration and script enqueue hooks.
- Includes file renames from wp-allstars to wpallstars.
This commit is contained in:
2025-04-19 13:12:37 +01:00
parent 2870a43ae5
commit f65d648a82
26 changed files with 2191 additions and 1591 deletions
+3 -3
View File
@@ -98,8 +98,8 @@ class WP_Allstars_Theme_Manager {
private static function get_theme_scripts() {
return '
jQuery(document).ready(function($) {
if ($("#wpa-theme-list").length) {
var $container = $("#wpa-theme-list");
if ($("#wpallstars-theme-list").length) {
var $container = $("#wpallstars-theme-list");
var $loadingOverlay = $container.find(".wp-allstars-loading-overlay");
// AJAX request to get themes
@@ -139,7 +139,7 @@ class WP_Allstars_Theme_Manager {
public static function display_tab_content() {
?>
<div class="wp-allstars-settings-content tab-content" id="theme">
<div id="wpa-theme-list" class="wpa-theme-container">
<div id="wpallstars-theme-list" class="wpallstars-theme-container">
<!-- Theme content will be loaded via AJAX -->
<div class="wp-allstars-loading-overlay">
<span class="spinner is-active"></span>