- // 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 ) ) {
- if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'read_post', $post->ID ) )
+ if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'edit_post', $revision->post_parent ) )
$post_edit_link = get_edit_post_link();
$post_title = '<a href="' . $post_edit_link . '">' . _draft_or_post_title() . '</a>';
$h1 = sprintf( __( 'Compare Revisions of “%1$s”' ), $post_title );
$post_edit_link = get_edit_post_link();
$post_title = '<a href="' . $post_edit_link . '">' . _draft_or_post_title() . '</a>';
$h1 = sprintf( __( 'Compare Revisions of “%1$s”' ), $post_title );