summaryrefslogtreecommitdiffstats
path: root/wp-includes/functions.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-06-20 12:35:31 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-06-20 12:35:31 +0000
commitc25dd9caaa9a4a31649fcdd2639cd663ab7036b4 (patch)
tree6f9e6e7aad284ae76d83d8bb7f2a0d06c672018d /wp-includes/functions.php
parent253937c75408a59922c63de868ca2ca5d8fbb59d (diff)
downloadwordpress-mu-c25dd9caaa9a4a31649fcdd2639cd663ab7036b4.tar.gz
wordpress-mu-c25dd9caaa9a4a31649fcdd2639cd663ab7036b4.tar.xz
wordpress-mu-c25dd9caaa9a4a31649fcdd2639cd663ab7036b4.zip
Merge from WP
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1003 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/functions.php')
-rw-r--r--wp-includes/functions.php18
1 files changed, 5 insertions, 13 deletions
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 1d2edc1..32d251c 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -246,7 +246,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');
+ wp_cache_add($setting, $value, 'options');
} else { // option does not exist, so we must cache its non-existence
$notoptions[$setting] = true;
wp_cache_set('notoptions', $notoptions, 'options');
@@ -314,7 +314,7 @@ function wp_load_alloptions() {
$alloptions = array();
foreach ( (array) $alloptions_db as $o )
$alloptions[$o->option_name] = $o->option_value;
- wp_cache_set('alloptions', $alloptions, 'options');
+ wp_cache_add('alloptions', $alloptions, 'options');
}
return $alloptions;
}
@@ -405,14 +405,7 @@ function delete_option($name) {
// Get the ID, if no ID then return
$option = $wpdb->get_row("SELECT option_id, autoload FROM $wpdb->options WHERE option_name = '$name'");
- if ( !$option->option_id ) {
- $alloptions = wp_load_alloptions();
- if ( isset($alloptions[$name]) ) {
- unset($alloptions[$name]);
- wp_cache_set('alloptions', $alloptions, 'options');
- }
- return false;
- }
+ if ( !$option->option_id ) return false;
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name = '$name'");
if ( 'yes' == $option->autoload ) {
$alloptions = wp_load_alloptions();
@@ -420,10 +413,9 @@ function delete_option($name) {
unset($alloptions[$name]);
wp_cache_set('alloptions', $alloptions, 'options');
}
+ } else {
+ wp_cache_delete($name, 'options');
}
-
- wp_cache_delete($name, 'options');
-
return true;
}