]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/revision.php
WordPress 4.7.1-scripts
[autoinstalls/wordpress.git] / wp-admin / revision.php
index 40328599d4f37b76d22a1a6f39ae3981ddbc4cd4..c86f78a451f0a842064a6666f61e7f19fd51ca20 100644 (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;
        }
@@ -63,7 +63,7 @@ default :
        if ( ! $post = get_post( $revision->post_parent ) )
                break;
 
-       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 ) )
                break;
 
        // Revisions disabled and we're not looking at an autosave
@@ -74,8 +74,9 @@ default :
 
        $post_edit_link = get_edit_post_link();
        $post_title     = '<a href="' . $post_edit_link . '">' . _draft_or_post_title() . '</a>';
+       /* translators: 1: Post title */
        $h1             = sprintf( __( 'Compare Revisions of &#8220;%1$s&#8221;' ), $post_title );
-       $return_to_post = '<a href="' . $post_edit_link . '">' . __( '&larr; Return to post editor' ) . '</a>';
+       $return_to_post = '<a href="' . $post_edit_link . '">' . __( '&larr; Return to editor' ) . '</a>';
        $title          = __( 'Revisions' );
 
        $redirect = false;
@@ -116,8 +117,8 @@ get_current_screen()->add_help_tab( array(
 ) );
 
 $revisions_sidebar  = '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
-$revisions_sidebar .= '<p>' . __( '<a href="https://codex.wordpress.org/Revision_Management" target="_blank">Revisions Management</a>' ) . '</p>';
-$revisions_sidebar .= '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>';
+$revisions_sidebar .= '<p>' . __( '<a href="https://codex.wordpress.org/Revision_Management">Revisions Management</a>' ) . '</p>';
+$revisions_sidebar .= '<p>' . __( '<a href="https://wordpress.org/support/">Support Forums</a>' ) . '</p>';
 
 get_current_screen()->set_help_sidebar( $revisions_sidebar );