mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Actually make use of wp_cache_add to avoid unnecessary cache writes. Props skeltoac. fixes #4138
git-svn-id: https://develop.svn.wordpress.org/trunk@5248 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -229,7 +229,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');
|
||||
@@ -294,7 +294,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user