Changeset 969 for trunk/wp-admin/options.php
- Timestamp:
- 03/11/2004 08:51:50 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/options.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/options.php
r957 r969 65 65 $options = $wpdb->get_results("SELECT $tableoptions.option_id, option_name, option_type, option_value, option_admin_level FROM $tableoptions WHERE option_name IN ($option_names)"); 66 66 // die(var_dump($options)); 67 68 // HACK 69 // Options that if not there have 0 value but need to be something like "closed" 70 $nonbools = array('default_ping_status', 'default_comment_status'); 67 71 if ($options) { 68 72 foreach ($options as $option) { … … 72 76 $new_val = $_POST[$option->option_name]; 73 77 if (!$new_val) $new_val = 0; 74 75 if ($new_val != $old_val) { 76 // get type and validate 77 $msg = validate_option($option, $this_name, $new_val); 78 if ($msg == '') { 79 //no error message 80 $result = $wpdb->query("UPDATE $tableoptions SET option_value = '$new_val' WHERE option_id = $option->option_id"); 81 if (!$result) { 82 $db_errors .= " SQL error while saving $this_name. "; 83 } else { 84 ++$any_changed; 85 } 86 } else { 87 $validation_message .= $msg; 88 } 78 if( in_array($option->option_name, $nonbools) && $new_val == 0 ) $new_value = 'closed'; 79 if ($new_val !== $old_val) { 80 $query = "UPDATE $tableoptions SET option_value = '$new_val' WHERE option_id = $option->option_id"; 81 $result = $wpdb->query($query); 82 //if( in_array($option->option_name, $nonbools)) die('boo'.$query); 83 if (!$result) { 84 $db_errors .= " SQL error while saving $this_name. "; 85 } else { 86 ++$any_changed; 87 } 89 88 } 90 89 } … … 143 142 <ul id="adminmenu2"> 144 143 <li><a href="options-general.php">General</a></li> 144 <li><a href="options-writing.php">Writing</a></li> 145 <li><a href="options-reading.php">Reading</a></li> 146 <li><a href="options-discussion.php">Discussion</a></li> 145 147 <?php 146 148 //Iterate through the available option groups.
Note: See TracChangeset
for help on using the changeset viewer.