[wp-trac] [WordPress Trac] #26577: Unable to compare post with single revision

WordPress Trac noreply at wordpress.org
Thu Dec 12 19:56:02 UTC 2013


#26577: Unable to compare post with single revision
--------------------------+-----------------------------
 Reporter:  bamadesigner  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Revisions     |    Version:  3.8
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 If your post type supports 'revisions', the "Revisions" meta box, and the
 revisions section of the "Publish" meta box, are only added to your edit
 post screen if you have more than one revision.

 But what if you only have one revision that you want to view/compare?
 Shouldn't the logic be "if ( count( $revisions ) >= 1 )"?

 The logic is on line 128 of the wp-admin/edit-form-advanced.php file.

 Here's the code starting with line 124:

 {{{
 if ( post_type_supports($post_type, 'revisions') && 'auto-draft' !=
 $post->post_status ) {
         $revisions = wp_get_post_revisions( $post_ID );

         // We should aim to show the revisions metabox only when there are
 revisions.
         if ( count( $revisions ) > 1 ) {
                 reset( $revisions ); // Reset pointer for key()
                 $publish_callback_args = array( 'revisions_count' =>
 count( $revisions ), 'revision_id' => key( $revisions ) );
                 add_meta_box('revisionsdiv', __('Revisions'),
 'post_revisions_meta_box', null, 'normal', 'core');
         }
 }
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/26577>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list