diff --git a/wp-includes/class-wp-post-type.php b/wp-includes/class-wp-post-type.php index 0099515050..bb148067c0 100644 --- a/wp-includes/class-wp-post-type.php +++ b/wp-includes/class-wp-post-type.php @@ -343,7 +343,7 @@ final class WP_Post_Type { * @since 5.3.0 * @var WP_REST_Controller $rest_controller */ - private $rest_controller; + public $rest_controller; /** * Constructor. @@ -722,6 +722,10 @@ final class WP_Post_Type { $this->rest_controller = new $class( $this->name ); } + if ( ! ( $this->rest_controller instanceof $class ) ) { + return null; + } + return $this->rest_controller; } } diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 4a00336e34..2b71a76cb0 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -15,15 +15,6 @@ * @see WP_REST_Controller */ class WP_REST_Posts_Controller extends WP_REST_Controller { - - /** - * Instances of post type controllers keyed by post type. - * - * @since 5.3.0 - * @var WP_REST_Controller[] - */ - private static $post_type_controllers = array(); - /** * Post type. * diff --git a/wp-includes/version.php b/wp-includes/version.php index e3146c9539..3cfbb17022 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-beta2-46434'; +$wp_version = '5.3-beta2-46435'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.