From facece4fa16bec55ecb1509d013b30f3c36a7ce8 Mon Sep 17 00:00:00 2001
From: Himani <himaniwork3010@gmail.com>
Date: Mon, 25 Nov 2019 10:01:26 +0530
Subject: [PATCH] Fix: #42238 Notice when Rest Comments controller is checking
---
.../endpoints/class-wp-rest-comments-controller.php | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
index 4fce45878c..87c982f52f 100644
|
a
|
b
|
class WP_REST_Comments_Controller extends WP_REST_Controller { |
| 1593 | 1593 | */ |
| 1594 | 1594 | protected function check_read_post_permission( $post, $request ) { |
| 1595 | 1595 | $post_type = get_post_type_object( $post->post_type ); |
| | 1596 | |
| | 1597 | // Return false if custom post type doesn't exist |
| | 1598 | if ( ! $post_type ) { |
| | 1599 | return false; |
| | 1600 | } |
| | 1601 | |
| 1596 | 1602 | $posts_controller = $post_type->get_rest_controller(); |
| 1597 | 1603 | |
| 1598 | 1604 | // Ensure the posts controller is specifically a WP_REST_Posts_Controller instance |