Skip to content

Commit

Permalink
Merge pull request #1179 from alleyinteractive/fix/issue-1178/reset-l…
Browse files Browse the repository at this point in the history
…oaded-settings-after-update

Issue-1178: API Settings: the latest `value` is rendered after an update
  • Loading branch information
renatonascalves authored Oct 14, 2024
2 parents 177d587 + e1cd9c3 commit bc3e50e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions admin/settings/class-admin-apple-settings-section.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit bc3e50e

Please sign in to comment.