From 0c5eda6c317e0d0cee7b0f2b26ae0f11e739f15d Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 8 Sep 2005 21:08:48 +0000 Subject: [PATCH] Check the option cache before querying. Props westi. fixes #1499 git-svn-id: http://svn.automattic.com/wordpress/trunk@2856 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index fceaf3668..e712428f5 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -368,7 +368,12 @@ function update_user_option( $user_id, $option_name, $newvalue, $global = false // thx Alex Stapleton, http://alex.vort-x.net/blog/ function add_option($name, $value = '', $description = '', $autoload = 'yes') { - global $wpdb; + global $wpdb, $cache_settings; + + // Make sure the option doesn't already exist + if ( isset($cache_settings->$name) ) + return; + $original = $value; if ( is_array($value) || is_object($value) ) $value = serialize($value);