update_option – odd caching thing
-
I’m revamping a plugin I wrote some time ago and have encountered an odd behavior with update_option().
The plugin uses a handful of options. Within a single function, a couple options get updated successfully. When it comes to the third option, it fails to update. (Actually, it fails to create the option, since the option doesn’t exist yet when the function starts running.)
Here’s the weird part: On my next page load, WP acts like the option was saved. get_option() returns what it should, even though the option doesn’t show up in phpMyAdmin.
But a couple page loads later, it’s gone.
I’m guessing that WP is caching the option (even though it’s not going into the DB). Any suggestions?
EDIT: Also, any ideas about what might be keeping the option from being created? The DB isn’t being lost. It’s a single-dimensional assoc. array I’m trying to write to the DB.
- The topic ‘update_option – odd caching thing’ is closed to new replies.