Make WordPress Core


Ignore:
Timestamp:
04/12/2007 02:27:12 AM (17 years ago)
Author:
ryan
Message:

Actually make use of wp_cache_add to avoid unnecessary cache writes. Props skeltoac. fixes #4138

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r5240 r5248  
    230230            if( is_object( $row) ) { // Has to be get_row instead of get_var because of funkiness with 0, false, null values
    231231                $value = $row->option_value;
    232                 wp_cache_set($setting, $value, 'options');
     232                wp_cache_add($setting, $value, 'options');
    233233            } else { // option does not exist, so we must cache its non-existence
    234234                $notoptions[$setting] = true;
     
    295295        foreach ( (array) $alloptions_db as $o )
    296296            $alloptions[$o->option_name] = $o->option_value;
    297         wp_cache_set('alloptions', $alloptions, 'options');
     297        wp_cache_add('alloptions', $alloptions, 'options');
    298298    }
    299299    return $alloptions;
Note: See TracChangeset for help on using the changeset viewer.