Skip to content

Commit 8ba4e7a

Browse files
author
rachelbaker
committed
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
1 parent 654f271 commit 8ba4e7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-admin/includes/ajax-actions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ function wp_ajax_get_comments( $action ) {
951951
$x = new WP_Ajax_Response();
952952
ob_start();
953953
foreach ( $wp_list_table->items as $comment ) {
954-
if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) )
954+
if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) && 0 === $comment->comment_approved )
955955
continue;
956956
get_comment( $comment );
957957
$wp_list_table->single_row( $comment );

0 commit comments

Comments
 (0)