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. 



git-svn-id: https://develop.svn.wordpress.org/trunk@37584 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Rachel Baker 2016-05-27 14:09:29 +00:00
parent 35a7acb459
commit 3ba3c42728
1 changed files with 1 additions and 1 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 );