When it comes to programming, the idea of temporary values or temporary variables or any way of storing data temporarily in memory isn’t anything new.
But when working with WordPress – which is stateless – we don’t always have that luxury. That is, it’s not simply a matter of, say, throwing something into the current session, reading it, and then removing it when we’re done with it.
And that’s when I’ve been giving more and more thought to the idea of temporary options, for lack of a better term of course. That is, whenever I need to store a value from a single page load, or request, to read in another page load, or another request, I’ll temporarily throw the value into the options table.

Temporary Options: An Exercise and Representation via Rudimentary Sketching
Is that sloppy? Maybe. Do we have a lot of other choices? It depends on how much of modern browser technology we want to use. That’s not the point of this post, though.
The point is that because of the way WordPress works, I wonder if our current, best strategy for maintaining temporary values that is most widely supported across installations is to temporarily add a value into the options table, read it, and then delete it once it’s been retrieved?
Continue reading