Make WordPress Core

Changeset 50128


Ignore:
Timestamp:
02/01/2021 10:01:19 PM (6 years ago)
Author:
adamsilverstein
Message:

Revisions: Address PHP/JS errors when viewing autosave on imported posts.

Fix an issue where viewing an autosave created on a post without any previous revisions would throw a PHP notice. Also fixes the revision screen which was broken in these cases and showed a console error.

Props iseulde.
Fixes #31249.

File:
1 edited

Legend:

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

    r50034 r50128  
    282282                        'id'         => $post->ID,
    283283                        'title'      => get_the_title( $post->ID ),
    284                         'author'     => $authors[ $post->post_author ],
     284                        'author'     => $authors[ $revision->post_author ],
    285285                        'date'       => date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_modified ) ),
    286286                        'dateShort'  => date_i18n( _x( 'j M @ H:i', 'revision date short format' ), strtotime( $post->post_modified ) ),
Note: See TracChangeset for help on using the changeset viewer.