WordPress.org

Make WordPress Core

Changeset 12931


Ignore:
Timestamp:
02/02/2010 09:53:26 PM (11 years ago)
Author:
ryan
Message:

Give network level upgrades separate API that is run when upgrading the main blog. see #11644

File:
1 edited

Legend:

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

    r12854 r12931  
    317317    make_db_current_silent();
    318318    upgrade_all();
     319    if ( is_multisite() && is_main_site() )
     320        upgrade_network();
    319321    wp_cache_flush();
    320322
    321323    if ( is_multisite() ) {
    322         if ( $wpdb->get_row( "SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = '{$wpdb->blogid}'" ) ) {
     324        if ( $wpdb->get_row( "SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = '{$wpdb->blogid}'" ) )
    323325            $wpdb->query( "UPDATE {$wpdb->blog_versions} SET db_version = '{$wp_db_version}' WHERE blog_id = '{$wpdb->blogid}'" );
    324         } else {
     326        else
    325327            $wpdb->query( "INSERT INTO {$wpdb->blog_versions} ( `blog_id` , `db_version` , `last_updated` ) VALUES ( '{$wpdb->blogid}', '{$wp_db_version}', NOW());" );
    326         }
    327328    }
    328329}
     
    10621063 * Execute changes made in WordPress 3.0.
    10631064 *
    1064  * @since 3.0
     1065 * @since 3.0.0
    10651066 */
    10661067function upgrade_300() {
    10671068    populate_roles_300();
     1069}
     1070
     1071/**
     1072 * Execute network level changes
     1073 *
     1074 * @since 3.0.0
     1075 */
     1076function upgrade_network() {
     1077    // 2.8
     1078    if ( $wp_current_db_version < 11549 ) {
     1079        $wpmu_sitewide_plugins = get_site_option( 'wpmu_sitewide_plugins' );
     1080        $active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' );
     1081        if ( $wpmu_sitewide_plugins ) {
     1082            if ( !$active_sitewide_plugins )
     1083                $sitewide_plugins = (array) $wpmu_sitewide_plugins;
     1084            else
     1085                $sitewide_plugins = array_merge( (array) $active_sitewide_plugins, (array) $wpmu_sitewide_plugins );
     1086
     1087            update_site_option( 'active_sitewide_plugins', $sitewide_plugins );
     1088        }
     1089        update_site_option( 'wpmu_sitewide_plugins', '' );
     1090        update_site_option( 'deactivated_sitewide_plugins', '' );
     1091    }
    10681092}
    10691093
Note: See TracChangeset for help on using the changeset viewer.