Changeset 1979 for trunk/wp-includes/functions.php
- Timestamp:
- 12/19/2004 02:30:40 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r1972 r1979 373 373 374 374 // If the new and old values are the same, no need to update. 375 if ($newvalue == get_ settings($option_name)) {375 if ($newvalue == get_option($option_name)) { 376 376 return true; 377 377 } 378 379 // If it's not there add it 380 if ( !$wpdb->get_var("SELECT option_name FROM $wpdb->options WHERE option_name = '$option_name'") ) 381 add_option($option_name); 378 382 379 383 $newvalue = $wpdb->escape($newvalue); … … 385 389 386 390 // thx Alex Stapleton, http://alex.vort-x.net/blog/ 387 function add_option($name, $value = '', $description = '' ) {391 function add_option($name, $value = '', $description = '', $autoload = 'yes') { 388 392 global $wpdb; 389 393 if ( is_array($value) || is_object($value) ) … … 394 398 $value = $wpdb->escape($value); 395 399 $description = $wpdb->escape($description); 396 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_value, option_description ) VALUES ('$name', '$value', '$description')");400 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_value, option_description, autoload) VALUES ('$name', '$value', '$description', '$autoload')"); 397 401 398 402 if($wpdb->insert_id) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)