Make WordPress Core

Changeset 4820


Ignore:
Timestamp:
01/27/2007 11:06:46 PM (20 years ago)
Author:
markjaquith
Message:

Have add_option() for options whose non-existence has been cached clear that cached non-existence before adding the option. Nice catch by Westi. fixes #3692

File:
1 edited

Legend:

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

    r4798 r4820  
    302302        global $wpdb;
    303303
    304         // Make sure the option doesn't already exist
    305         if ( false !== get_option($name) )
    306                 return;
     304        // Make sure the option doesn't already exist we can check the cache before we ask for a db query
     305        if ( true === wp_cache_get($name, 'notoptions') )
     306                wp_cache_delete($name, 'notoptions');
     307        else
     308                if ( false !== get_option($name) )
     309                        return;
    307310
    308311        $value = maybe_serialize($value);
Note: See TracChangeset for help on using the changeset viewer.