summaryrefslogtreecommitdiffstats
path: root/wp-admin/upgrade-functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-admin/upgrade-functions.php')
-rw-r--r--wp-admin/upgrade-functions.php38
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