PluginProbe
Gutenberg / 12.1.0
Gutenberg v12.1.0
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
← All changes | lib/rest-api.php +33 -0 12.6.012.1.0 View file →
@@ -22,8 +22,17 @@
22 22 }
23 23 add_action( 'rest_api_init', 'gutenberg_register_url_details_routes' );
24 24
25 25 /**
26 + * Registers the block pattern directory.
27 + */
28 +function gutenberg_register_rest_pattern_directory() {
29 + $block_directory_controller = new WP_REST_Pattern_Directory_Controller();
30 + $block_directory_controller->register_routes();
31 +}
32 +add_filter( 'rest_api_init', 'gutenberg_register_rest_pattern_directory' );
33 +
34 +/**
26 35 * Registers the menu locations REST API routes.
27 36 */
28 37 function gutenberg_register_rest_menu_location() {
29 38 $nav_menu_location = new WP_REST_Menu_Locations_Controller();
@@ -49,8 +58,23 @@
49 58 }
50 59 add_action( 'rest_api_init', 'gutenberg_register_rest_customizer_nonces' );
51 60
52 61 /**
62 + * Registers the Sidebars & Widgets REST API routes.
63 + */
64 +function gutenberg_register_sidebars_and_widgets_endpoint() {
65 + $sidebars = new WP_REST_Sidebars_Controller();
66 + $sidebars->register_routes();
67 +
68 + $widgets = new WP_REST_Widgets_Controller();
69 + $widgets->register_routes();
70 +
71 + $widget_types = new WP_REST_Widget_Types_Controller();
72 + $widget_types->register_routes();
73 +}
74 +add_action( 'rest_api_init', 'gutenberg_register_sidebars_and_widgets_endpoint' );
75 +
76 +/**
53 77 * Registers the Block editor settings REST API routes.
54 78 */
55 79 function gutenberg_register_block_editor_settings() {
56 80 $editor_settings = new WP_REST_Block_Editor_Settings_Controller();
@@ -208,8 +232,17 @@
208 232 );
209 233 return $query_params;
210 234 }
211 235 add_filter( 'rest_user_collection_params', 'gutenberg_rest_user_collection_params_has_published_posts' );
236 +
237 +/**
238 + * Registers the Global Styles REST API routes.
239 + */
240 +function gutenberg_register_global_styles_endpoints() {
241 + $editor_settings = new Gutenberg_REST_Global_Styles_Controller();
242 + $editor_settings->register_routes();
243 +}
244 +add_action( 'rest_api_init', 'gutenberg_register_global_styles_endpoints' );
212 245
213 246 /**
214 247 * Registers the Edit Site's Export REST API routes.
215 248 *