Make WordPress Core


Ignore:
Timestamp:
02/27/2004 05:48:00 AM (23 years ago)
Author:
saxmatt
Message:

Some new options and an option cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upgrade-functions.php

    r946 r949  
    652652function upgrade_101() {
    653653        global $wpdb, $tableoptionvalues, $tablelinkcategories, $tableposts, $tablecategories, $tablecomments, $tablelinks;
    654         // Fix possible duplicate problem from CVS
     654        // Fix possible duplicate problem from CVS, we can REMOVE this later
    655655        $option59 = $wpdb->get_results("SELECT * FROM $tableoptionvalues WHERE option_id  = '59'");
    656656        if (1 < count($option59)) {
    … …  
    673673}
    674674
     675
    675676function upgrade_110() {
    676677  global $wpdb, $tableusers, $tablecomments, $tableposts, $tableoptiongroups, $tableoptiongroup_options, $tableoptions, $tablepostmeta;
    … …  
    709710
    710711        // Add blog_charset option
    711         if(!$wpdb->get_var("SELECT * FROM $tableoptions WHERE option_id = '93'")) {
    712                 $wpdb->query("INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level) VALUES (93, 'blog_charset', 3, 'utf-8', 'Your blog&#8217;s charset (here&#8217;s a <a href=\"http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html\">list of possible charsets</a>)', 8)");
     712        if(!$wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'blog_charset'")) {
     713                $wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('blog_charset', 3, 'utf-8', 8)");
    713714        }
    714715
    … …  
    768769        ");
    769770
     771        // First we need to enlarge option_value so it can hold larger values:
     772        $wpdb->query("ALTER TABLE `$tableoptions` CHANGE `option_value` `option_value` TEXT NOT NULL");
     773       
     774        // Now an option for blog pinging
     775        if(!$wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'ping_sites'")) {
     776                $wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('ping_sites', 3, '', 8)");
     777        }
     778       
     779        // Option for using the advanced edit screen by default
     780        if(!$wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'advanced_edit'")) {
     781                $wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('advanced_edit', 3, '0', 8)");
     782        }
    770783}
    771784
Note: See TracChangeset for help on using the changeset viewer.