Changeset 1681 for trunk/wp-admin/options.php
- Timestamp:
- 09/17/2004 01:05:06 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/options.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/options.php
r1599 r1681 59 59 // HACK 60 60 // Options that if not there have 0 value but need to be something like "closed" 61 $nonbools = array('default_ping_status', 'default_comment_status');61 $nonbools = array('default_ping_status', 'default_comment_status'); 62 62 if ($options) { 63 63 foreach ($options as $option) { … … 66 66 $old_val = $option->option_value; 67 67 $new_val = $_POST[$option->option_name]; 68 if (!$new_val) {69 if (3 == $option->option_type)70 $new_val = '';71 else72 $new_val = 0;73 }74 if( in_array($option->option_name, $nonbools) && $new_val == 0) $new_val = 'closed';68 if (!$new_val) { 69 if (3 == $option->option_type) 70 $new_val = ''; 71 else 72 $new_val = 0; 73 } 74 if( in_array($option->option_name, $nonbools) && $new_val == '0' ) $new_val = 'closed'; 75 75 if ($new_val !== $old_val) 76 $result = $wpdb->query("UPDATE $wpdb->options SET option_value = '$new_val' WHERE option_name = '$option->option_name'"); 77 } 76 $result = $wpdb->query("UPDATE $wpdb->options SET option_value = '$new_val' WHERE option_name = '$option->option_name'"); 78 77 } 78 } 79 79 unset($cache_settings); // so they will be re-read 80 80 get_settings('siteurl'); // make it happen now
Note: See TracChangeset
for help on using the changeset viewer.