From 53a00e5becb43552468b5b7b7a8ab735f642fb3a Mon Sep 17 00:00:00 2001 From: Renato Alves <19148962+renatonascalves@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:42:06 -0300 Subject: [PATCH 1/3] WIP: issue-1178 From 4394589bf5cb92cdccb898cceff5cf7470cc493b Mon Sep 17 00:00:00 2001 From: Renato Alves <19148962+renatonascalves@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:43:11 -0300 Subject: [PATCH 2/3] Update the cached settings after an update --- admin/settings/class-admin-apple-settings-section.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/admin/settings/class-admin-apple-settings-section.php b/admin/settings/class-admin-apple-settings-section.php index 5ad1c7d6..9f6c540d 100644 --- a/admin/settings/class-admin-apple-settings-section.php +++ b/admin/settings/class-admin-apple-settings-section.php @@ -643,5 +643,13 @@ public function save_settings() { // Save to options. update_option( self::$section_option_name, $settings, 'no' ); + + /** + * Update the cached settings with new one after an update. + * + * The `self::get_value` method uses this cached data. By resetting it, we ensure + * that the new value is used after an update instead of the old value. + */ + self::$loaded_settings = $settings; } } From 60a38d9a535cfc35f62abb05288ae6c60ba69e87 Mon Sep 17 00:00:00 2001 From: Renato Alves <19148962+renatonascalves@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:43:25 -0300 Subject: [PATCH 3/3] Ready for review