Make WordPress Core


Ignore:
Timestamp:
09/17/2004 01:05:06 PM (21 years ago)
Author:
donncha
Message:

The two flags "default_ping_status" and "default_comment_status" weren't being
recorded properly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options.php

    r1599 r1681  
    5959// HACK
    6060// 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');
    6262    if ($options) {
    6363        foreach ($options as $option) {
     
    6666                $old_val = $option->option_value;
    6767                $new_val = $_POST[$option->option_name];
    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';
     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';
    7575                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'");
    7877            }
     78        }
    7979        unset($cache_settings); // so they will be re-read
    8080        get_settings('siteurl'); // make it happen now
Note: See TracChangeset for help on using the changeset viewer.