+ * Execute changes made in WordPress 3.5.
+ *
+ * @since 3.5.0
+ */
+function upgrade_350() {
+ global $wp_current_db_version, $wpdb;
+
+ if ( $wp_current_db_version < 22006 && $wpdb->get_var( "SELECT link_id FROM $wpdb->links LIMIT 1" ) )
+ update_option( 'link_manager_enabled', 1 ); // Previously set to 0 by populate_options()
+
+ if ( $wp_current_db_version < 21811 && is_main_site() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
+ $meta_keys = array();
+ foreach ( array_merge( get_post_types(), get_taxonomies() ) as $name ) {
+ if ( false !== strpos( $name, '-' ) )
+ $meta_keys[] = 'edit_' . str_replace( '-', '_', $name ) . '_per_page';
+ }
+ if ( $meta_keys ) {
+ $meta_keys = implode( "', '", $meta_keys );
+ $wpdb->query( "DELETE FROM $wpdb->usermeta WHERE meta_key IN ('$meta_keys')" );
+ }
+ }
+
+ if ( $wp_current_db_version < 22422 && $term = get_term_by( 'slug', 'post-format-standard', 'post_format' ) )
+ wp_delete_term( $term->term_id, 'post_format' );
+}
+
+/**
+ * Execute changes made in WordPress 3.7.
+ *
+ * @since 3.7.0
+ */
+function upgrade_370() {
+ global $wp_current_db_version;
+ if ( $wp_current_db_version < 25824 )
+ wp_clear_scheduled_hook( 'wp_auto_updates_maybe_update' );
+}
+
+/**
+ * Execute changes made in WordPress 3.7.2.
+ *
+ * @since 3.7.2
+ * @since 3.8.0
+ */
+function upgrade_372() {
+ global $wp_current_db_version;
+ if ( $wp_current_db_version < 26148 )
+ wp_clear_scheduled_hook( 'wp_maybe_auto_update' );
+}
+
+/**
+ * Execute changes made in WordPress 3.8.0.
+ *
+ * @since 3.8.0
+ */
+function upgrade_380() {
+ global $wp_current_db_version;
+ if ( $wp_current_db_version < 26691 ) {
+ deactivate_plugins( array( 'mp6/mp6.php' ), true );
+ }
+}
+
+/**
+ * Execute changes made in WordPress 4.0.0.
+ *
+ * @since 4.0.0
+ */
+function upgrade_400() {
+ global $wp_current_db_version;
+ if ( $wp_current_db_version < 29630 ) {
+ if ( ! is_multisite() && false === get_option( 'WPLANG' ) ) {
+ if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && in_array( WPLANG, get_available_languages() ) ) {
+ update_option( 'WPLANG', WPLANG );
+ } else {
+ update_option( 'WPLANG', '' );
+ }
+ }
+ }
+}
+
+/**
+ * Execute changes made in WordPress 4.2.0.
+ *
+ * @since 4.2.0
+ */
+function upgrade_420() {
+ global $wp_current_db_version, $wpdb;
+
+ if ( $wp_current_db_version < 31351 && $wpdb->charset === 'utf8mb4' ) {
+ if ( is_multisite() ) {
+ $tables = $wpdb->tables( 'blog' );
+ } else {
+ $tables = $wpdb->tables( 'all' );
+ }
+
+ foreach ( $tables as $table ) {
+ maybe_convert_table_to_utf8mb4( $table );
+ }
+ }
+}
+
+/**
+ * Executes network-level upgrade routines.