Make WordPress Core

Changeset 24025


Ignore:
Timestamp:
04/18/2013 04:43:59 AM (12 years ago)
Author:
azaozz
Message:

Revisions: when upgrading the revision author don't add a copy of the post as latest revision when some of the revisions are already at v1. See #16215

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/revision.php

    r24021 r24025  
    628628
    629629    reset( $revisions );
     630    $add_last = true;
    630631
    631632    do {
     
    639640            continue;
    640641
    641         // 1 is the latest revision version, so we're already up to date
    642         if ( 0 < $this_revision_version )
     642        // 1 is the latest revision version, so we're already up to date.
     643        // No need to add a copy of the post as latest revision.
     644        if ( 0 < $this_revision_version ) {
     645            $add_last = false;
    643646            continue;
     647        }
    644648
    645649        // Always update the revision version
     
    670674
    671675    // Add a copy of the post as latest revision.
    672     wp_save_post_revision( $post->ID );
     676    if ( $add_last )
     677        wp_save_post_revision( $post->ID );
     678
    673679    return true;
    674680}
Note: See TracChangeset for help on using the changeset viewer.