Changeset 5788
- Timestamp:
- 07/07/2007 04:06:29 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r5709 r5788 315 315 wp_protect_special_option($name); 316 316 317 // Make sure the option doesn't already exist we can check thecache before we ask for a db query317 // Make sure the option doesn't already exist. We can check the 'notoptions' cache before we ask for a db query 318 318 $notoptions = wp_cache_get('notoptions', 'options'); 319 if ( is_array($notoptions) && isset($notoptions[$name]) ) { 320 unset($notoptions[$name]); 321 wp_cache_set('notoptions', $notoptions, 'options'); 322 } elseif ( false !== get_option($name) ) { 319 if ( !is_array($notoptions) || !isset($notoptions[$name]) ) 320 if ( false !== get_option($name) ) 323 321 return; 324 }325 322 326 323 $value = maybe_serialize($value); … … 333 330 } else { 334 331 wp_cache_set($name, $value, 'options'); 332 } 333 334 // This option exists now 335 $notoptions = wp_cache_get('notoptions', 'options'); // yes, again... we need it to be fresh 336 if ( is_array($notoptions) && isset($notoptions[$name]) ) { 337 unset($notoptions[$name]); 338 wp_cache_set('notoptions', $notoptions, 'options'); 335 339 } 336 340
Note: See TracChangeset
for help on using the changeset viewer.