REST API: Ensure users with "moderate_comments" capability may edit comments.

Props meloniq.
Fixes #47024.



git-svn-id: https://develop.svn.wordpress.org/trunk@46433 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
K. Adam White
2019-10-08 04:00:25 +00:00
parent 4e716dbce1
commit e17e5aab68
3 changed files with 46 additions and 3 deletions

View File

@@ -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 );