diff --git a/admin/includes/class-settings-manager.php b/admin/includes/class-settings-manager.php
index e2170a3..3ad003b 100644
--- a/admin/includes/class-settings-manager.php
+++ b/admin/includes/class-settings-manager.php
@@ -71,7 +71,7 @@ class WP_Allstars_Settings_Manager {
?>
diff --git a/includes/class-wp-allstars-admin-colors.php b/includes/class-wp-allstars-admin-colors.php
new file mode 100644
index 0000000..02fe973
--- /dev/null
+++ b/includes/class-wp-allstars-admin-colors.php
@@ -0,0 +1,98 @@
+option_name, false);
+
+ // Get the scheme to set
+ $scheme = $modern_colors_enabled ? $this->modern_scheme : $this->default_scheme;
+
+ // Update user meta to set the color scheme
+ update_user_meta($user_id, 'admin_color', $scheme);
+ }
+
+ /**
+ * Handle color scheme update via AJAX
+ * Runs early to apply the color scheme change before the general option update handler
+ */
+ public function handle_color_scheme_update() {
+ // Check for required params
+ if (!isset($_POST['option']) || !isset($_POST['value'])) {
+ return;
+ }
+
+ // Only process our specific option
+ if ($_POST['option'] !== $this->option_name) {
+ return;
+ }
+
+ // Get the current user ID
+ $user_id = get_current_user_id();
+ if (!$user_id) {
+ return;
+ }
+
+ // Determine which scheme to set based on the value
+ $value = (bool) $_POST['value'];
+ $scheme = $value ? $this->modern_scheme : $this->default_scheme;
+
+ // Update the user's color scheme
+ update_user_meta($user_id, 'admin_color', $scheme);
+ }
+}
\ No newline at end of file
diff --git a/wp-allstars-plugin.php b/wp-allstars-plugin.php
index efdea80..b265b00 100644
--- a/wp-allstars-plugin.php
+++ b/wp-allstars-plugin.php
@@ -46,6 +46,7 @@ register_activation_hook(__FILE__, 'wp_allstars_activate');
* Load core plugin components
*/
require_once plugin_dir_path(__FILE__) . 'includes/class-wp-allstars-auto-upload.php';
+require_once plugin_dir_path(__FILE__) . 'includes/class-wp-allstars-admin-colors.php';
// Load admin-specific components
if (is_admin()) {
@@ -72,8 +73,6 @@ if (is_admin()) {
require_once plugin_dir_path(__FILE__) . 'admin/settings.php';
}
-
-
/**
* Auto Upload feature initialization
*
@@ -87,6 +86,15 @@ function wp_allstars_init_auto_upload() {
}
add_action('init', 'wp_allstars_init_auto_upload');
+/**
+ * Initialize core features
+ */
+function wp_allstars_init_features() {
+ // Initialize the Admin Colors feature
+ new WP_Allstars_Admin_Colors();
+}
+add_action('plugins_loaded', 'wp_allstars_init_features');
+
/**
* Initialize core plugin classes
*/