Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: only run form submit logic when saving admin settings
Addresses an issue where checkbox toggles on the admin page revert back to `unchecked`. Although users would check these inputs and then save their settings, the value would revert back after a while, or when logging out of the site and back in. This was due to the form submission code executing even though the admin "Save Settings" button was not pressed. It seems that WordPress will submit page forms for different reasons, which can incorrectly trigger our "Save Settings" logic and inadvertently overwrite values. This commit adds a more strict check so that submission logic is only run when the value is explicitly set to `Save Settings`. In other words, only when the user presses the "Save Settings" button on the page. Follow up to [#346](#346)
- Loading branch information