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.



Built from https://develop.svn.wordpress.org/trunk@38009


git-svn-id: http://core.svn.wordpress.org/trunk@37950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Rachel Baker 2016-07-08 01:16:31 +00:00
parent 602f231a26
commit c283b3c0c6
2 changed files with 3 additions and 3 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;
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-beta2-38008';
$wp_version = '4.6-beta2-38009';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.