From 81a4d0a10cb616f354fc97c2c44a9e1054d6455b Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Tue, 16 Oct 2018 22:28:28 +0000 Subject: [PATCH] REST API: Introduce themes endpoint to expose theme-supports values for the active theme. In order to correctly render parts of its UI, the new editor needs to be aware of the active theme's post-formats and post-thumbnails support. This data is exposed by querying for the active theme on a new /wp/v2/themes endpoint for sufficiently privileged users. props desrosj. Fixes #45016. Built from https://develop.svn.wordpress.org/branches/5.0@43734 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43563 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rest-api.php | 4 ++++ wp-includes/version.php | 2 +- wp-settings.php | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php index 82d856a063..e1403d71bd 100644 --- a/wp-includes/rest-api.php +++ b/wp-includes/rest-api.php @@ -233,6 +233,10 @@ function create_initial_rest_routes() { // Settings. $controller = new WP_REST_Settings_Controller; $controller->register_routes(); + + // Themes. + $controller = new WP_REST_Themes_Controller; + $controller->register_routes(); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 5a114b1d71..fbc6664c11 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43733'; +$wp_version = '5.0-alpha-43734'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-settings.php b/wp-settings.php index bacf4cfddd..44c8a91a07 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -234,6 +234,7 @@ require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-terms-controller.p require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-users-controller.php' ); require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-comments-controller.php' ); require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-settings-controller.php' ); +require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-themes-controller.php' ); require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-meta-fields.php' ); require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-comment-meta-fields.php' ); require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-post-meta-fields.php' );