Make WordPress Core

Ticket #45677: 45677.11.diff

File 45677.11.diff, 1.1 KB (added by dlh, 5 years ago)
  • src/wp-includes/class-wp-post-type.php

    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 { 
    704704         *                                 is set not to show in rest.
    705705         */
    706706        public function get_rest_controller() {
     707                if ( $this->rest_controller ) {
     708                        return $this->rest_controller;
     709                }
     710
    707711                if ( ! $this->show_in_rest ) {
    708712                        return null;
    709713                }
  • src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

    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
     
    1515 * @see WP_REST_Controller
    1616 */
    1717class 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 
    2718        /**
    2819         * Post type.
    2920         *