From de6d164870f7fd256ed10b48dd7c6266b469702c Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Tue, 8 Oct 2019 04:02:02 +0000 Subject: [PATCH] REST API: Ensure users with "moderate_comments" capability may edit comments. Props meloniq. Fixes #47024. Built from https://develop.svn.wordpress.org/trunk@46433 git-svn-id: http://core.svn.wordpress.org/trunk@46231 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../rest-api/endpoints/class-wp-rest-comments-controller.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php index 0320efaae9..376959ad2a 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php @@ -1672,8 +1672,8 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { return false; } - if ( ! current_user_can( 'moderate_comments' ) ) { - return false; + if ( current_user_can( 'moderate_comments' ) ) { + return true; } return current_user_can( 'edit_comment', $comment->comment_ID ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 08d8059fc0..f46843d35f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-beta2-46432'; +$wp_version = '5.3-beta2-46433'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.