diff --git src/wp-includes/class-wp-post-type.php src/wp-includes/class-wp-post-type.php
index 0099515050..24b9d6b4c1 100644
|
|
final class WP_Post_Type { |
704 | 704 | * is set not to show in rest. |
705 | 705 | */ |
706 | 706 | public function get_rest_controller() { |
| 707 | if ( $this->rest_controller ) { |
| 708 | return $this->rest_controller; |
| 709 | } |
| 710 | |
707 | 711 | if ( ! $this->show_in_rest ) { |
708 | 712 | return null; |
709 | 713 | } |
diff --git src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
index 4a00336e34..2b71a76cb0 100644
|
|
|
15 | 15 | * @see WP_REST_Controller |
16 | 16 | */ |
17 | 17 | class WP_REST_Posts_Controller extends WP_REST_Controller { |
18 | | |
19 | | /** |
20 | | * Instances of post type controllers keyed by post type. |
21 | | * |
22 | | * @since 5.3.0 |
23 | | * @var WP_REST_Controller[] |
24 | | */ |
25 | | private static $post_type_controllers = array(); |
26 | | |
27 | 18 | /** |
28 | 19 | * Post type. |
29 | 20 | * |