Changeset 3790891 for ultimate-store-kit/trunk/includes/API/Settings.php
- Timestamp:
- 11/08/2026 11:10:57 AM (less than one hour ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ultimate-store-kit/trunk/includes/API/Settings.php
r3504294 r3790891 38 38 'callback' => [$this, 'save_settings'], 39 39 ], 40 [ 41 'path' => '/optimization/regenerate', 42 'methods' => 'POST', 43 'callback' => [$this, 'regenerate_combined_assets'], 44 ], 40 45 ]; 41 46 } … … 60 65 61 66 $sanitized = $this->sanitize_settings($settings); 67 68 // ultimate_store_kit_other_settings is shared: every module page keeps its 69 // switch there, and Pro switches modules through its own route. A page 70 // posts only what it knows, so merge instead of replacing, or saving one 71 // page would switch off modules turned on elsewhere since it loaded. 72 if ('ultimate_store_kit_other_settings' === $section) { 73 $stored = get_option($section, []); 74 $sanitized = array_merge(is_array($stored) ? $stored : [], $sanitized); 75 } 76 62 77 update_option($section, $sanitized); 63 78 64 79 return $this->success(['message' => __('Settings saved successfully.', 'ultimate-store-kit')]); 65 80 } 81 82 /** 83 * Delete the combined asset files; pages rebuild them on their next view. 84 */ 85 public function regenerate_combined_assets(\WP_REST_Request $request) { 86 if (class_exists('\UltimateStoreKit\Includes\Asset_Combiner')) { 87 \UltimateStoreKit\Includes\Asset_Combiner::flush(); 88 } 89 90 return $this->success([ 91 'message' => __('Combined files cleared. Pages rebuild them on their next visit.', 'ultimate-store-kit'), 92 'stats' => class_exists('\UltimateStoreKit\Includes\Asset_Combiner') ? \UltimateStoreKit\Includes\Asset_Combiner::stats() : null, 93 ]); 94 } 66 95 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)