WordPress.org

Make WordPress Core

Changeset 10768


Ignore:
Timestamp:
03/11/2009 01:07:12 AM (12 years ago)
Author:
ryan
Message:

Set autoload in populate options query

Location:
trunk
Files:
2 edited

Legend:

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

    r10767 r10768  
    309309    );
    310310
     311    // Set autoload to no for these options
     312    $fat_options = array( 'moderation_keys', 'recently_edited', 'blacklist_keys' );
     313
    311314    $existing_options = $wpdb->get_col("SELECT option_name FROM $wpdb->options");
    312315
     
    315318        if ( in_array($option, $existing_options) )
    316319            continue;
     320        if ( in_array($option, $fat_options) )
     321            $autoload = 'no';
     322        else
     323            $autoload = 'yes';
     324
    317325        $option = $wpdb->escape($option);
    318326        $value = $wpdb->escape($value);
    319327        if ( !empty($insert) )
    320328            $insert .= ', ';
    321         $insert .= "('$option', '$value')";
     329        $insert .= "('$option', '$value', '$autoload')";
    322330    }
    323331
    324332    if ( !empty($insert) )
    325         $wpdb->query("INSERT INTO $wpdb->options (option_name, option_value) VALUES " . $insert);
     333        $wpdb->query("INSERT INTO $wpdb->options (option_name, option_value, autoload) VALUES " . $insert);
    326334
    327335    // in case it is set, but blank, update "home"
     
    330338    // Delete unused options
    331339    $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 'can_compress_scripts');
    332     foreach ($unusedoptions as $option) :
     340    foreach ($unusedoptions as $option)
    333341        delete_option($option);
    334     endforeach;
    335 
    336     // Set up a few options not to load by default
    337     $fatoptions = array( 'moderation_keys', 'recently_edited', 'blacklist_keys' );
    338     foreach ($fatoptions as $fatoption)
    339         $wpdb->update( $wpdb->options, array('autoload' => 'no'), array('option_name' => $fatoption) );
    340342}
    341343
  • trunk/wp-includes/version.php

    r10733 r10768  
    1616 * @global int $wp_db_version
    1717 */
    18 $wp_db_version = 10733;
     18$wp_db_version = 10738;
    1919
    2020?>
Note: See TracChangeset for help on using the changeset viewer.