Ticket #4429: add_option_trunk.diff
File add_option_trunk.diff, 1.3 KB (added by , 18 years ago) |
---|
-
wp-includes/functions.php
314 314 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); 327 324 $autoload = ( 'no' === $autoload ) ? 'no' : 'yes'; … … 334 331 wp_cache_set($name, $value, 'options'); 335 332 } 336 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'); 339 } 340 337 341 $name = $wpdb->escape($name); 338 342 $value = $wpdb->escape($value); 339 343 $description = $wpdb->escape($description);