WordPress.org

Make WordPress Core

Changeset 37854


Ignore:
Timestamp:
06/23/2016 02:31:15 PM (4 years ago)
Author:
swissspidy
Message:

Revisions: Remove unused post meta data during database upgrade.

Introduced in [23811], WordPress displayed some additional information for restored revisions for a short period of time. This was removed again in [25194], but the meta data was still being saved unnecessarily.

After 3 years and no plugins ever using this meta data, it's time to stop collecting it.

Fixes #36526.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r37583 r37854  
    552552    if ( $wp_current_db_version < 36686 )
    553553        upgrade_450();
     554
     555    if ( $wp_current_db_version < 37854 )
     556        upgrade_460();
    554557
    555558    maybe_disable_link_manager();
     
    16891692
    16901693/**
     1694 * Executes changes made in WordPress 4.6.0.
     1695 *
     1696 * @ignore
     1697 * @since 4.6.0
     1698 *
     1699 * @global int  $wp_current_db_version Current database version.
     1700 * @global wpdb $wpdb                  WordPress database abstraction object.
     1701 */
     1702function upgrade_460() {
     1703    delete_post_meta_by_key( '_post_restored_from' );
     1704}
     1705
     1706/**
    16911707 * Executes network-level upgrade routines.
    16921708 *
  • trunk/src/wp-includes/revision.php

    r37544 r37854  
    379379        return $post_id;
    380380
    381     // Add restore from details
    382     $restore_details = array(
    383         'restored_revision_id' => $revision_id,
    384         'restored_by_user'     => get_current_user_id(),
    385         'restored_time'        => time()
    386     );
    387     update_post_meta( $post_id, '_post_restored_from', $restore_details );
    388 
    389381    // Update last edit user
    390382    update_post_meta( $post_id, '_edit_last', get_current_user_id() );
  • trunk/src/wp-includes/version.php

    r37847 r37854  
    1212 * @global int $wp_db_version
    1313 */
    14 $wp_db_version = 36686;
     14$wp_db_version = 37854;
    1515
    1616/**
Note: See TracChangeset for help on using the changeset viewer.