Make WordPress Core

Ticket #29044: 29044.3.diff

File 29044.3.diff, 1.2 KB (added by adamsilverstein, 11 years ago)

update comment to better reflect cause of issue

  • src/wp-admin/includes/revision.php

     
    177177                );
    178178        }
    179179
     180        /**
     181         * If we only have one revision, the initial revision is missing; The only way this happens is
     182         * when we have an autsosave and the user has clicked 'View the Autosave'
     183         */
     184        if ( 1 === sizeof( $revisions ) ) {
     185                $revisions[ $post->ID ] = array(
     186                        'id'         => $post->ID,
     187                        'title'      => get_the_title( $post->ID ),
     188                        'author'     => $authors[ $post->post_author ],
     189                        'date'       => date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->modified ) ),
     190                        'dateShort'  => date_i18n( _x( 'j M @ G:i', 'revision date short format' ), strtotime( $post->modified ) ),
     191                        'timeAgo'    => sprintf( __( '%s ago' ), human_time_diff( strtotime( $post->$modified_gmt ), $now_gmt ) ),
     192                        'autosave'   => false,
     193                        'current'    => true,
     194                        'restoreUrl' => false,
     195                );
     196                $current_id = $post->ID;
     197        }
     198
    180199        /*
    181200         * If a post has been saved since the last revision (no revisioned fields
    182201         * were changed), we may not have a "current" revision. Mark the latest