WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/08/2019 01:41:29 PM (2 months ago)
Author:
kadamwhite
Message:

REST API: Ensure rest_controller instantiates the post type's declared REST controller class.

Ensures that the ::get_rest_controller() method will always return an instanceof the expected controller class, or null.
Removes unused private static property $post_type_controllers.

Props dlh, TimothyBlynJacobs.
Fixes #45677.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

    r46272 r46435  
    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.
Note: See TracChangeset for help on using the changeset viewer.