WordPress.org

Make WordPress Core

Ticket #27734: 27734.2.diff

File 27734.2.diff, 1.7 KB (added by nacin, 7 years ago)
  • src/wp-admin/includes/upgrade.php

     
    411411        if ( $wp_current_db_version < 26691 )
    412412                upgrade_380();
    413413
     414        if ( $wp_current_db_version < 30000 )
     415                upgrade_382();
     416
    414417        maybe_disable_link_manager();
    415418
    416419        maybe_disable_automattic_widgets();
     
    12511254                deactivate_plugins( array( 'mp6/mp6.php' ), true );
    12521255        }
    12531256}
     1257
    12541258/**
     1259 * Execute changes made in WordPress 3.8.2.
     1260 *
     1261 * @since 3.8.2
     1262 */
     1263function upgrade_382() {
     1264        global $wp_current_db_version, $wpdb;
     1265        if ( $wp_current_db_version < 30000 ) {
     1266                // Find all lost Quick Draft auto-drafts and promote them to proper drafts.
     1267                // Auto Drafts never have content as that would mean they should have been promoted.
     1268                // Bring them back in place, with no date changes or other processing.
     1269                $post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type = 'post'
     1270                        AND post_status = 'auto-draft' AND post_date >= '2014-04-08 00:00:00' AND post_content <> ''" );
     1271                foreach ( $post_ids as $post_id ) {
     1272                        $wpdb->update( $wpdb->posts, array( 'post_status' => 'draft' ), array( 'ID' => $post_id ) );
     1273                        clean_post_cache( $post_id );
     1274                }
     1275        }
     1276}
     1277
     1278/**
    12551279 * Execute network level changes
    12561280 *
    12571281 * @since 3.0.0
  • src/wp-includes/version.php

     
    1111 *
    1212 * @global int $wp_db_version
    1313 */
    14 $wp_db_version = 26691;
     14$wp_db_version = 26692;
    1515
    1616/**
    1717 * Holds the TinyMCE version