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 9582b72672..bfa3159bf1 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 @@ -1454,6 +1454,11 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { */ protected function check_read_post_permission( $post ) { $posts_controller = new WP_REST_Posts_Controller( $post->post_type ); + $post_type = get_post_type_object( $post->post_type ); + + if ( post_password_required( $post ) ) { + return current_user_can( $post_type->cap->edit_post, $post->ID ); + } return $posts_controller->check_read_permission( $post ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index ba383348cd..ec63ca0885 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta4-39294'; +$wp_version = '4.7-beta4-39295'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.