Make WordPress Core


Ignore:
Timestamp:
04/06/2013 11:43:05 PM (12 years ago)
Author:
azaozz
Message:

Revisions: move the call to _wp_upgrade_revisions_of_post() to edit-form-advanced.php, in the code block checking whether we should show the revisions postbox. See #16215

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r23886 r23929  
    228228}
    229229
    230 // We should aim to show the revisions metabox only when there are revisions.
    231 if ( post_type_supports($post_type, 'revisions') && 'auto-draft' != $post->post_status && count( wp_get_post_revisions( $post_ID ) ) > 1 )
    232     add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', null, 'normal', 'core');
     230if ( post_type_supports($post_type, 'revisions') && 'auto-draft' != $post->post_status ) {
     231    $revisions = wp_get_post_revisions( $post_ID );
     232
     233    // Check if the revisions have been upgraded
     234    if ( ! empty( $revisions ) && _wp_get_post_revision_version( reset( $revisions ) ) < 1 )
     235        _wp_upgrade_revisions_of_post( $post, $revisions );
     236
     237    // We should aim to show the revisions metabox only when there are revisions.
     238    if ( count( $revisions ) > 1 )
     239        add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', null, 'normal', 'core');
     240}
    233241
    234242do_action('add_meta_boxes', $post_type, $post);
Note: See TracChangeset for help on using the changeset viewer.