diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-05-21 18:37:58 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-05-21 18:37:58 +0000 |
commit | 89fe0ff804e7c6497ebacc8b341ac89974f6f255 (patch) | |
tree | 3fce310b29c685008fdbb75c5ab531bc3a6ae12a /wp-admin/upgrade-functions.php | |
parent | a139071806ba941346a109fbefb2d5f22bae1cc4 (diff) | |
download | wordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.tar.gz wordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.tar.xz wordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.zip |
WP Merge to rev 5499, this is a big one! Test it before you put it live!
Test only, not for production use yet
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@972 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/upgrade-functions.php')
-rw-r--r-- | wp-admin/upgrade-functions.php | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/wp-admin/upgrade-functions.php b/wp-admin/upgrade-functions.php index 35095d0..e3357ec 100644 --- a/wp-admin/upgrade-functions.php +++ b/wp-admin/upgrade-functions.php @@ -184,6 +184,12 @@ function upgrade_all() { if ( $wp_current_db_version < 4351 ) upgrade_old_slugs(); + + if ( $wp_current_db_version < 5200 ) { + upgrade_230(); + } + + maybe_disable_automattic_widgets(); $wp_rewrite->flush_rules(); @@ -574,6 +580,14 @@ function upgrade_210() { } } +function upgrade_230() { + global $wp_current_db_version; + + if ( $wp_current_db_version < 5200 ) { + populate_roles_230(); + } +} + function upgrade_old_slugs() { // upgrade people who were using the Redirect Old Slugs plugin global $wpdb; @@ -666,7 +680,15 @@ function get_alloptions_110() { // Version of get_option that is private to install/upgrade. function __get_option($setting) { global $wpdb; - + + if ( $setting == 'home' && defined( 'WP_HOME' ) ) { + return preg_replace( '|/+$|', '', constant( 'WP_HOME' ) ); + } + + if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) { + return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) ); + } + $option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'"); if ( 'home' == $setting && '' == $option ) @@ -1109,4 +1131,16 @@ function wp_check_mysql_version() { die(sprintf(__('<strong>ERROR</strong>: WordPress %s requires MySQL 4.0.0 or higher'), $wp_version)); } -?> +function maybe_disable_automattic_widgets() { + $plugins = __get_option( 'active_plugins' ); + + foreach ( (array) $plugins as $plugin ) { + if ( basename( $plugin ) == 'widgets.php' ) { + array_splice( $plugins, array_search( $plugin, $plugins ), 1 ); + update_option( 'active_plugins', $plugins ); + break; + } + } +} + +?>
\ No newline at end of file |