From 9913b6eec408bb0e64ff8ef2ee6b8f826c39df2d Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Fri, 27 May 2016 14:10:28 +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. Built from https://develop.svn.wordpress.org/trunk@37584 git-svn-id: http://core.svn.wordpress.org/trunk@37552 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index a717397dde..f3751cb025 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/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 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index c60202fc22..d3d02ba0d0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.