Revisions: Change the capability needed to view revision diffs to `edit_post`.
Merge of [37779] to the 4.4 branch. Built from https://develop.svn.wordpress.org/branches/4.4@37796 git-svn-id: http://core.svn.wordpress.org/branches/4.4@37761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e22ceae1b7
commit
2a00e5a736
|
@ -2754,7 +2754,7 @@ function wp_ajax_get_revision_diffs() {
|
||||||
if ( ! $post = get_post( (int) $_REQUEST['post_id'] ) )
|
if ( ! $post = get_post( (int) $_REQUEST['post_id'] ) )
|
||||||
wp_send_json_error();
|
wp_send_json_error();
|
||||||
|
|
||||||
if ( ! current_user_can( 'read_post', $post->ID ) )
|
if ( ! current_user_can( 'edit_post', $post->ID ) )
|
||||||
wp_send_json_error();
|
wp_send_json_error();
|
||||||
|
|
||||||
// Really just pre-loading the cache here.
|
// Really just pre-loading the cache here.
|
||||||
|
|
|
@ -63,7 +63,7 @@ default :
|
||||||
if ( ! $post = get_post( $revision->post_parent ) )
|
if ( ! $post = get_post( $revision->post_parent ) )
|
||||||
break;
|
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;
|
break;
|
||||||
|
|
||||||
// Revisions disabled and we're not looking at an autosave
|
// Revisions disabled and we're not looking at an autosave
|
||||||
|
|
Loading…
Reference in New Issue