Changeset 5789
- Timestamp:
- 07/07/2007 04:08:04 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/wp-includes/functions.php
r5713 r5789 355 355 wp_protect_special_option($name); 356 356 357 // Make sure the option doesn't already exist we can check thecache before we ask for a db query357 // Make sure the option doesn't already exist. We can check the 'notoptions' cache before we ask for a db query 358 358 $notoptions = wp_cache_get('notoptions', 'options'); 359 if ( is_array($notoptions) && isset($notoptions[$name]) ) { 360 unset($notoptions[$name]); 361 wp_cache_set('notoptions', $notoptions, 'options'); 362 } elseif ( false !== get_option($name) ) { 359 if ( !is_array($notoptions) || !isset($notoptions[$name]) ) 360 if ( false !== get_option($name) ) 363 361 return; 364 }365 362 366 363 $value = maybe_serialize($value); 364 $autoload = ( 'no' === $autoload ) ? 'no' : 'yes'; 367 365 368 366 if ( 'yes' == $autoload ) { … … 372 370 } else { 373 371 wp_cache_set($name, $value, 'options'); 372 } 373 374 // This option exists now 375 $notoptions = wp_cache_get('notoptions', 'options'); // yes, again... we need it to be fresh 376 if ( is_array($notoptions) && isset($notoptions[$name]) ) { 377 unset($notoptions[$name]); 378 wp_cache_set('notoptions', $notoptions, 'options'); 374 379 } 375 380
Note: See TracChangeset
for help on using the changeset viewer.