Automatically updating the options.php stored values
-
In my custom plugin, I am making a json call to an external source to get information. The information is being handled at a main website for easy ability to update information on areas like hours, pricing, etc and then sent out to the sites in WordPress, all of that functionality is working perfectly.
From there I did a register_setting for each field I wanted to save, assigned all of the different fields from the array to their own variables, then did an update_option to assign those values to the hidden input fields on the settings page.
From what I understand, the settings are stored in WordPress via the options.php in the form handler that gets the info on submit. I was wondering if there is a way to set a time out so that the options.php auto-updates and pulls new info from json call, so that the end user does not need to keep going to the settings page to refresh the updated values. Doing the calls directly in the theme code, rather than storing them into the inputs that options.php saves on the options page, would result in a json call every time the site is pulled up. Any advice would be amazing.
- The topic ‘Automatically updating the options.php stored values’ is closed to new replies.