*
* @since 2.1.0
*
- * @param string $blog_title Blog title.
+ * @param string $blog_title Site title.
* @param string $user_name User's username.
* @param string $user_email User's email.
- * @param bool $public Whether blog is public.
+ * @param bool $public Whether site is public.
* @param string $deprecated Optional. Not used.
* @param string $user_password Optional. User's chosen password. Default empty (random password).
* @param string $language Optional. Language chosen. Default empty.
/*
* Create default user. If the user already exists, the user tables are
- * being shared among blogs. Just set the role in that case.
+ * being shared among sites. Just set the role in that case.
*/
$user_id = username_exists($user_name);
$user_password = trim($user_password);
*
* @since 2.1.0
*
- * @param string $blog_title Blog title.
- * @param string $blog_url Blog url.
+ * @param string $blog_title Site title.
+ * @param string $blog_url Site url.
* @param int $user_id User ID.
* @param string $password User's Password.
*/
* Contains conditional checks to determine which upgrade scripts to run,
* based on database version and WP version being updated-to.
*
+ * @ignore
* @since 1.0.1
*
* @global int $wp_current_db_version
if ( $wp_current_db_version < 35700 )
upgrade_440();
+ if ( $wp_current_db_version < 36686 )
+ upgrade_450();
+
maybe_disable_link_manager();
maybe_disable_automattic_widgets();
/**
* Execute changes made in WordPress 1.0.
*
+ * @ignore
* @since 1.0.0
*
* @global wpdb $wpdb WordPress database abstraction object.
/**
* Execute changes made in WordPress 1.0.1.
*
+ * @ignore
* @since 1.0.1
*
* @global wpdb $wpdb WordPress database abstraction object.
/**
* Execute changes made in WordPress 1.2.
*
+ * @ignore
* @since 1.2.0
*
* @global wpdb $wpdb WordPress database abstraction object.
/**
* Execute changes made in WordPress 1.5.
*
+ * @ignore
* @since 1.5.0
*
* @global wpdb $wpdb WordPress database abstraction object.
/**
* Execute changes made in WordPress 2.0.
*
+ * @ignore
* @since 2.0.0
*
* @global wpdb $wpdb WordPress database abstraction object.
/**
* Execute changes made in WordPress 2.1.
*
+ * @ignore
* @since 2.1.0
*
* @global wpdb $wpdb WordPress database abstraction object.
/**
* Execute changes made in WordPress 2.3.
*
+ * @ignore
* @since 2.3.0
*
* @global wpdb $wpdb WordPress database abstraction object.
/**
* Remove old options from the database.
*
+ * @ignore
* @since 2.3.0
*
* @global wpdb $wpdb WordPress database abstraction object.
/**
* Remove old categories, link2cat, and post2cat database tables.
*
+ * @ignore
* @since 2.3.0
*
* @global wpdb $wpdb WordPress database abstraction object.
/**
* Upgrade old slugs made in version 2.2.
*
+ * @ignore
* @since 2.2.0
*
* @global wpdb $wpdb WordPress database abstraction object.
/**
* Execute changes made in WordPress 2.5.0.
*
+ * @ignore
* @since 2.5.0
*
* @global int $wp_current_db_version
/**
* Execute changes made in WordPress 2.5.2.
*
+ * @ignore
* @since 2.5.2
*
* @global wpdb $wpdb WordPress database abstraction object.
/**
* Execute changes made in WordPress 2.6.
*
+ * @ignore
* @since 2.6.0
*
* @global int $wp_current_db_version
/**
* Execute changes made in WordPress 2.7.
*
+ * @ignore
* @since 2.7.0
*
* @global wpdb $wpdb WordPress database abstraction object.
/**
* Execute changes made in WordPress 2.8.
*
+ * @ignore
* @since 2.8.0
*
* @global int $wp_current_db_version
/**
* Execute changes made in WordPress 2.9.
*
+ * @ignore
* @since 2.9.0
*
* @global int $wp_current_db_version
/**
* Execute changes made in WordPress 3.0.
*
+ * @ignore
* @since 3.0.0
*
* @global int $wp_current_db_version
/**
* Execute changes made in WordPress 3.3.
*
+ * @ignore
* @since 3.3.0
*
* @global int $wp_current_db_version
/**
* Execute changes made in WordPress 3.4.
*
+ * @ignore
* @since 3.4.0
*
* @global int $wp_current_db_version
/**
* Execute changes made in WordPress 3.5.
*
+ * @ignore
* @since 3.5.0
*
* @global int $wp_current_db_version
/**
* Execute changes made in WordPress 3.7.
*
+ * @ignore
* @since 3.7.0
*
* @global int $wp_current_db_version
/**
* Execute changes made in WordPress 3.7.2.
*
+ * @ignore
* @since 3.7.2
* @since 3.8.0
*
/**
* Execute changes made in WordPress 3.8.0.
*
+ * @ignore
* @since 3.8.0
*
* @global int $wp_current_db_version
/**
* Execute changes made in WordPress 4.0.0.
*
+ * @ignore
* @since 4.0.0
*
* @global int $wp_current_db_version
/**
* Execute changes made in WordPress 4.2.0.
*
+ * @ignore
* @since 4.2.0
*
* @global int $wp_current_db_version
/**
* Executes changes made in WordPress 4.3.0.
*
+ * @ignore
* @since 4.3.0
*
* @global int $wp_current_db_version Current version.
/**
* Executes comments changes made in WordPress 4.3.0.
*
+ * @ignore
* @since 4.3.0
*
* @global int $wp_current_db_version Current version.
/**
* Executes changes made in WordPress 4.3.1.
*
+ * @ignore
* @since 4.3.1
*/
function upgrade_431() {
/**
* Executes changes made in WordPress 4.4.0.
*
+ * @ignore
* @since 4.4.0
*
* @global int $wp_current_db_version Current version.
}
}
+/**
+ * Executes changes made in WordPress 4.5.0.
+ *
+ * @ignore
+ * @since 4.5.0
+ *
+ * @global int $wp_current_db_version Current database version.
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_450() {
+ global $wp_current_db_version, $wpdb;
+
+ if ( $wp_current_db_version < 36180 ) {
+ wp_clear_scheduled_hook( 'wp_maybe_auto_update' );
+ }
+
+ // Remove unused email confirmation options, moved to usermeta.
+ if ( $wp_current_db_version < 36679 && is_multisite() ) {
+ $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name REGEXP '^[0-9]+_new_email$'" );
+ }
+
+ // Remove unused user setting for wpLink.
+ delete_user_setting( 'wplink' );
+}
+
/**
* Executes network-level upgrade routines.
*
*/
$iqueries = apply_filters( 'dbdelta_insert_queries', $iqueries );
+ $text_fields = array( 'tinytext', 'text', 'mediumtext', 'longtext' );
+ $blob_fields = array( 'tinyblob', 'blob', 'mediumblob', 'longblob' );
+
$global_tables = $wpdb->tables( 'global' );
foreach ( $cqueries as $table => $qry ) {
// Upgrade global tables only for the main site. Don't upgrade at all if conditions are not optimal.
// Is actual field type different from the field type in query?
if ($tablefield->Type != $fieldtype) {
+ $do_change = true;
+ if ( in_array( strtolower( $fieldtype ), $text_fields ) && in_array( strtolower( $tablefield->Type ), $text_fields ) ) {
+ if ( array_search( strtolower( $fieldtype ), $text_fields ) < array_search( strtolower( $tablefield->Type ), $text_fields ) ) {
+ $do_change = false;
+ }
+ }
+
+ if ( in_array( strtolower( $fieldtype ), $blob_fields ) && in_array( strtolower( $tablefield->Type ), $blob_fields ) ) {
+ if ( array_search( strtolower( $fieldtype ), $blob_fields ) < array_search( strtolower( $tablefield->Type ), $blob_fields ) ) {
+ $do_change = false;
+ }
+ }
+
+ if ( $do_change ) {
// Add a query to change the column type
- $cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)];
- $for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}";
+ $cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)];
+ $for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}";
+ }
}
// Get the default value from the array