Advertisements

upgrade_network

Definition:
function upgrade_network() {}

Execute network level changes

Source code

function upgrade_network() {

	global $wp_current_db_version, $wpdb;

	// 2.8

	if ( $wp_current_db_version < 11549 ) {

		$wpmu_sitewide_plugins = get_site_option( 'wpmu_sitewide_plugins' );

		$active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' );

		if ( $wpmu_sitewide_plugins ) {

			if ( !$active_sitewide_plugins )

				$sitewide_plugins = (array) $wpmu_sitewide_plugins;

			else

				$sitewide_plugins = array_merge( (array) $active_sitewide_plugins, (array) $wpmu_sitewide_plugins );



			update_site_option( 'active_sitewide_plugins', $sitewide_plugins );

		}

		delete_site_option( 'wpmu_sitewide_plugins' );

		delete_site_option( 'deactivated_sitewide_plugins' );



		$start = 0;

		while( $rows = $wpdb->get_results( "SELECT meta_key, meta_value FROM {$wpdb->sitemeta} ORDER BY meta_id LIMIT $start, 20" ) ) {

			foreach( $rows as $row ) {

				$value = $row->meta_value;

				if ( !@unserialize( $value ) )

					$value = stripslashes( $value );

				if ( $value !== $row->meta_value ) {

					update_site_option( $row->meta_key, $value );

				}

			}

			$start += 20;

		}

	}

3253

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: