Changeset 3023
- Timestamp:
- 11/09/2005 06:15:55 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/options.php
r2763 r3023 59 59 if ($new_val !== $old_val) { 60 60 $result = $wpdb->query("UPDATE $wpdb->options SET option_value = '$new_val' WHERE option_name = '$option->option_name'"); 61 wp_cache_set($option->option_name, $new_val, 'options'); 61 62 $any_changed++; 62 63 } -
trunk/wp-includes/functions.php
r3012 r3023 268 268 269 269 if ( false === $value ) { 270 $value = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'"); 271 wp_cache_add($setting, $value, 'options'); 270 $value = $wpdb->get_row("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'"); 271 if( is_object( $value ) ) { 272 $value = $value->option_value; 273 wp_cache_set($setting, $value, 'options'); 274 } 272 275 } 273 276 … … 344 347 // If it's not there add it 345 348 if ( !$wpdb->get_var("SELECT option_name FROM $wpdb->options WHERE option_name = '$option_name'") ) 346 add_option($option_name );349 add_option($option_name, $newvalue); 347 350 348 351 wp_cache_set($option_name, $newvalue, 'options'); … … 366 369 367 370 // Make sure the option doesn't already exist 368 if ( false !== get_option($name , 'options') )371 if ( false !== get_option($name) ) 369 372 return; 370 373 … … 373 376 $value = serialize($value); 374 377 375 wp_cache_ add($name, $value, 'options');378 wp_cache_set($name, $value, 'options'); 376 379 377 380 $name = $wpdb->escape($name);
Note: See TracChangeset
for help on using the changeset viewer.