Comments: Display approved comments on the Edit Post screen to users without the `edit_comment` capability.

Matches logic in `wp_dashboard_recent_comments()` where we display approved comments regardless of the edit permission.

Props jfarthing84 for initial patch.
Fixes #24648. 


Built from https://develop.svn.wordpress.org/trunk@37584


git-svn-id: http://core.svn.wordpress.org/trunk@37552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Rachel Baker 2016-05-27 14:10:28 +00:00
parent 2f998cac7f
commit 9913b6eec4
2 changed files with 2 additions and 2 deletions

View File

@ -951,7 +951,7 @@ function wp_ajax_get_comments( $action ) {
$x = new WP_Ajax_Response();
ob_start();
foreach ( $wp_list_table->items as $comment ) {
if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) )
if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) && 0 === $comment->comment_approved )
continue;
get_comment( $comment );
$wp_list_table->single_row( $comment );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-alpha-37583';
$wp_version = '4.6-alpha-37584';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.