Changeset 2715
- Timestamp:
- 07/16/2005 09:13:14 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r2704 r2715 328 328 function update_option($option_name, $newvalue) { 329 329 global $wpdb, $cache_settings; 330 331 $newvalue = trim($newvalue); // I can't think of any situation we wouldn't want to trim 332 333 // If the new and old values are the same, no need to update. 334 if ( $newvalue == get_option($option_name) ) 335 return true; 336 330 337 if ( is_array($newvalue) || is_object($newvalue) ) 331 338 $newvalue = serialize($newvalue); 332 333 $newvalue = trim($newvalue); // I can't think of any situation we wouldn't want to trim334 335 // If the new and old values are the same, no need to update.336 if ($newvalue == get_option($option_name)) {337 return true;338 }339 339 340 340 // If it's not there add it … … 343 343 344 344 $newvalue = $wpdb->escape($newvalue); 345 $option_name = $wpdb->escape( $option_name ); 345 346 $wpdb->query("UPDATE $wpdb->options SET option_value = '$newvalue' WHERE option_name = '$option_name'"); 346 347 $cache_settings = get_alloptions(); // Re cache settings
Note: See TracChangeset
for help on using the changeset viewer.