Remove notoptions caching. Multile rewrite_rules options were being created. See #3692 #2268

git-svn-id: https://develop.svn.wordpress.org/trunk@4831 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2007-01-30 01:43:39 +00:00
parent 13a2f96ea7
commit b0f28a6dff
7 changed files with 34 additions and 16 deletions
+4 -15
View File
@@ -203,10 +203,6 @@ function is_serialized_string($data) {
function get_option($setting) {
global $wpdb;
// prevent non-existent options from triggering multiple queries
if ( true === wp_cache_get($setting, 'notoptions') )
return false;
$value = wp_cache_get($setting, 'options');
if ( false === $value ) {
@@ -219,8 +215,7 @@ function get_option($setting) {
if( is_object( $row) ) { // Has to be get_row instead of get_var because of funkiness with 0, false, null values
$value = $row->option_value;
wp_cache_set($setting, $value, 'options');
} else { // option does not exist, so we must cache its non-existence
wp_cache_set($setting, true, 'notoptions');
} else {
return false;
}
}
@@ -279,9 +274,6 @@ function update_option($option_name, $newvalue) {
return true;
}
if ( true === wp_cache_get($option_name, 'notoptions') )
wp_cache_delete($option_name, 'notoptions');
$_newvalue = $newvalue;
$newvalue = maybe_serialize($newvalue);
@@ -301,12 +293,9 @@ function update_option($option_name, $newvalue) {
function add_option($name, $value = '', $description = '', $autoload = 'yes') {
global $wpdb;
// 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;
// Make sure the option doesn't already exist
if ( false !== get_option($name) )
return;
$value = maybe_serialize($value);