Revisions: Allow autosaves to be restored when revisions are disabled.

Fixes bug introduced in [23639] where autosaves are not restored if revisions are disabled.

Props adamsilverstein.
Fixes #36262.




git-svn-id: https://develop.svn.wordpress.org/trunk@38009 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Rachel Baker 2016-07-08 01:15:19 +00:00
parent 9f254e6fb2
commit 437d80e56c
1 changed files with 2 additions and 2 deletions

View File

@ -40,8 +40,8 @@ case 'restore' :
if ( ! $post = get_post( $revision->post_parent ) )
break;
// Revisions disabled (previously checked autosaves && ! wp_is_post_autosave( $revision ))
if ( ! wp_revisions_enabled( $post ) ) {
// Restore if revisions are enabled or this is an autosave.
if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) {
$redirect = 'edit.php?post_type=' . $post->post_type;
break;
}