REST API: Add widget endpoints

Adds the sidebars, widgets and widget-types REST API endpoints from the
Gutenberg plugin.

Fixes #41683.
Props TimothyBlynJacobs.


git-svn-id: https://develop.svn.wordpress.org/trunk@50993 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Robert Anderson
2021-05-25 07:51:14 +00:00
parent 5f1cf9db57
commit 909bd7fad0
28 changed files with 5023 additions and 4 deletions

View File

@@ -313,6 +313,18 @@ function create_initial_rest_routes() {
$controller = new WP_REST_Plugins_Controller();
$controller->register_routes();
// Sidebars.
$controller = new WP_REST_Sidebars_Controller();
$controller->register_routes();
// Widget Types.
$controller = new WP_REST_Widget_Types_Controller();
$controller->register_routes();
// Widgets.
$controller = new WP_REST_Widgets_Controller();
$controller->register_routes();
// Block Directory.
$controller = new WP_REST_Block_Directory_Controller();
$controller->register_routes();