WordPress.org

Make WordPress Core

Ticket #27938: 27938.diff

File 27938.diff, 607 bytes (added by bobbingwide, 6 years ago)

Patch to reinstate test for autosave when post type doesn't support revisions

  • wp-admin/revision.php

     
    4040        if ( ! $post = get_post( $revision->post_parent ) )
    4141                break;
    4242
    43         // Revisions disabled (previously checked autosaves && ! wp_is_post_autosave( $revision ))
    44         if ( ! wp_revisions_enabled( $post ) ) {
     43        // Revisions disabled and it's not an autosave
     44        if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) {
    4545                $redirect = 'edit.php?post_type=' . $post->post_type;
    4646                break;
    4747        }