Skip to content

Commit c6a2ce1

Browse files
Apply suggestion from @westonruter
Co-authored-by: Weston Ruter <[email protected]>
1 parent 2dd66bc commit c6a2ce1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function get_items_permissions_check( $request ) {
147147
}
148148

149149
if ( $post && $is_note && ! $this->check_post_type_supports_notes( $post->post_type ) ) {
150-
if ( current_user_can( get_post_type_object( $post->post_type )->cap->edit_posts ) ) {
150+
if ( current_user_can( 'edit_post', $post->ID ) {
151151
return new WP_Error(
152152
'rest_comment_not_supported_post_type',
153153
__( 'Sorry, this post type does not support notes.' ),

0 commit comments

Comments
 (0)