From 2fd34af7175683ed2f964bfe2ae6c31aca70919d Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Sat, 27 Jan 2007 23:06:46 +0000 Subject: [PATCH] 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: https://develop.svn.wordpress.org/trunk@4820 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 062a2de765..88b9b785d3 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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);