WordPress.org

Make WordPress Core

Changeset 6039


Ignore:
Timestamp:
09/05/2007 07:20:53 PM (11 years ago)
Author:
markjaquith
Message:

Deprecate option_can_override, option_type, option_width, option_height, option_description, option_admin_level from options table. Props Nazgul. fixes #4390

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/schema.php

    r5825 r6039  
    7878  blog_id int(11) NOT NULL default '0',
    7979  option_name varchar(64) NOT NULL default '',
    80   option_can_override enum('Y','N') NOT NULL default 'Y',
    81   option_type int(11) NOT NULL default '1',
    8280  option_value longtext NOT NULL,
    83   option_width int(11) NOT NULL default '20',
    84   option_height int(11) NOT NULL default '8',
    85   option_description tinytext NOT NULL,
    86   option_admin_level int(11) NOT NULL default '1',
    8781  autoload enum('yes','no') NOT NULL default 'yes',
    8882  PRIMARY KEY  (option_id,blog_id,option_name),
     
    156150    $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
    157151    $guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
    158     add_option('siteurl', $guessurl, __('WordPress web address'));
    159     add_option('blogname', __('My Blog'), __('Blog title'));
    160     add_option('blogdescription', __('Just another WordPress weblog'), __('Short tagline'));
     152    add_option('siteurl', $guessurl);
     153    add_option('blogname', __('My Blog'));
     154    add_option('blogdescription', __('Just another WordPress weblog'));
    161155    add_option('new_users_can_blog', 0);
    162156    add_option('users_can_register', 0);
     
    204198    add_option('gmt_offset', date('Z') / 3600);
    205199    // 1.5
    206     add_option('default_email_category', 1, __('Posts by email go to this category'));
     200    add_option('default_email_category', 1);
    207201    add_option('recently_edited');
    208202    add_option('use_linksupdate', 0);
  • trunk/wp-admin/includes/upgrade.php

    r6026 r6039  
    192192        upgrade_230();
    193193
     194    if ( $wp_current_db_version < 6039 )
     195        upgrade_230_options_table();
    194196
    195197    maybe_disable_automattic_widgets();
     
    677679        $wpdb->query("UPDATE $wpdb->term_taxonomy SET count = '$count' WHERE term_taxonomy_id = '$term'");
    678680    }
     681}
     682
     683function upgrade_230_options_table() {
     684    global $wpdb;
     685    $old_options_fields = array( 'option_can_override', 'option_type', 'option_width', 'option_height', 'option_description', 'option_admin_level' );
     686    $wpdb->hide_errors();
     687    foreach ( $old_options_fields as $old )
     688        $wpdb->query("ALTER TABLE $wpdb->options DROP $old");
     689    $wpdb->show_errors();
    679690}
    680691
  • trunk/wp-admin/options.php

    r6023 r6039  
    8383
    8484    echo "</td>
    85     <td>$option->option_description</td>
    8685</tr>";
    8786endforeach;
  • trunk/wp-includes/functions.php

    r6031 r6039  
    330330// thx Alex Stapleton, http://alex.vort-x.net/blog/
    331331// expects $name to NOT be SQL-escaped
    332 function add_option($name, $value = '', $description = '', $autoload = 'yes') {
     332function add_option($name, $value = '', $deprecated = '', $autoload = 'yes') {
    333333    global $wpdb;
    334334
     
    362362    $name = $wpdb->escape($name);
    363363    $value = $wpdb->escape($value);
    364     $description = $wpdb->escape($description);
    365     $wpdb->query("INSERT INTO $wpdb->options (option_name, option_value, option_description, autoload) VALUES ('$name', '$value', '$description', '$autoload')");
     364    $wpdb->query("INSERT INTO $wpdb->options (option_name, option_value, autoload) VALUES ('$name', '$value', '$autoload')");
    366365
    367366    return;
  • trunk/wp-includes/version.php

    r6027 r6039  
    44
    55$wp_version = '2.3-beta2';
    6 $wp_db_version = 5540;
     6$wp_db_version = 6039;
    77
    88?>
Note: See TracChangeset for help on using the changeset viewer.