I’d like let some functions in my functions.php
file use update_option()
to save some local data, but the wp_options
table seems to be global to every piece of software on my site, so I have to give my data some long name to make sure it doesn’t collide with a name that someone else has chosen for their data. Is there a way around this?
Thanks
No, and I strongly advise against changing the WordPress Options table schema, you’ll run into many problems such as:
- No longer having a reliable update process
- Non-portable code
- You won’t be able to use the
get_options
suite of functions and the object caching and optimisations that come with them
If you managed to get it working with get_options
you’d be back were you started
My suggestion? $prefix.'_option_name'