Changeset 4820

Show
Ignore:
Timestamp:
01/27/07 23:06:46 (2 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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 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);