Are all options variables fetched from the database and loaded to cache on each request?
|
Yes, sort of. When the If your option is not auto loaded, WordPress then looks in the cache specifically for that option and returns the value if it's there. If that misses, the final fallback is to go to the database, fetch the value, set it the cache and then return it. Finally, if no option if found at all (eg. the option name was invalid), WordPress stores that option's name in a cached array called If you're worried about calling Check out the |
||||
|
|
|
No, only the options that are specifically loaded with autoload set to true See http://codex.wordpress.org/Function_Reference/add_option So if it is an option that is needed on every page, when you add it to the db, set autoload=true. After that, just use get_option normally - wp will handle the cacheing etc. |
|||
|
|
