WordPress.org

Make WordPress Core

Changeset 38009


Ignore:
Timestamp:
07/08/2016 01:15:19 AM (4 years ago)
Author:
rachelbaker
Message:

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.

File:
1 edited

Legend:

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

    r37779 r38009  
    4141        break;
    4242
    43     // Revisions disabled (previously checked autosaves && ! wp_is_post_autosave( $revision ))
    44     if ( ! wp_revisions_enabled( $post ) ) {
     43    // Restore if revisions are enabled or this is an autosave.
     44    if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) {
    4545        $redirect = 'edit.php?post_type=' . $post->post_type;
    4646        break;
Note: See TracChangeset for help on using the changeset viewer.