From 3ba3c42728d944b32e9c0c1c29a35fb2bda2f6f8 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Fri, 27 May 2016 14:09:29 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/ajax-actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index a717397dde..f3751cb025 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -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 );