mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
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. Built from https://develop.svn.wordpress.org/trunk@50128 git-svn-id: http://core.svn.wordpress.org/trunk@49807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3e12235a79
commit
68c6e9982b
@ -281,7 +281,7 @@ function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null
|
||||
$revisions[ $post->ID ] = array(
|
||||
'id' => $post->ID,
|
||||
'title' => get_the_title( $post->ID ),
|
||||
'author' => $authors[ $post->post_author ],
|
||||
'author' => $authors[ $revision->post_author ],
|
||||
'date' => date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_modified ) ),
|
||||
'dateShort' => date_i18n( _x( 'j M @ H:i', 'revision date short format' ), strtotime( $post->post_modified ) ),
|
||||
/* translators: %s: Human-readable time difference. */
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.7-alpha-50127';
|
||||
$wp_version = '5.7-alpha-50128';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user