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
gutenberg / lib / compat / wordpress-5.8.1 / widget-render-api-endpoint / index.php

index.php in Gutenberg 12.1.0, at lib/compat/wordpress-5.8.1/widget-render-api-endpoint/index.php

23 lines 642 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Shims the /wp/v2/widget-types/<id>/render endpoint in WP versions where it's missing
4 *
5 * @package gutenberg
6 */
7
8 // Load the polyfill class.
9 require_once __DIR__ . '/class-gb-rest-widget-render-endpoint-polyfill.php';
10
11 /**
12 * Registers routes from the GB_REST_Widget_Render_Endpoint_Polyfill class.
13 */
14 function setup_widget_render_api_endpoint_polyfill() {
15 $polyfill = new GB_REST_Widget_Render_Endpoint_Polyfill();
16 $polyfill->register_routes();
17 }
18
19 // Priority should be larger than 99 which is the one used for registering the core routes.
20 add_action( 'rest_api_init', 'setup_widget_render_api_endpoint_polyfill', 100 );
21
22
23