Have add_option() for options whose non-existence has been cached clear that cached non-existence before adding the option. Nice catch by Westi. fixes #3692

git-svn-id: http://svn.automattic.com/wordpress/trunk@4820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2007-01-27 23:06:46 +00:00
parent bc7b2b7606
commit 7873820f8c
1 changed files with 6 additions and 3 deletions

View File

@ -301,9 +301,12 @@ function update_option($option_name, $newvalue) {
function add_option($name, $value = '', $description = '', $autoload = 'yes') {
global $wpdb;
// Make sure the option doesn't already exist
if ( false !== get_option($name) )
return;
// Make sure the option doesn't already exist we can check the cache before we ask for a db query
if ( true === wp_cache_get($name, 'notoptions') )
wp_cache_delete($name, 'notoptions');
else
if ( false !== get_option($name) )
return;
$value = maybe_serialize($value);