# gutenberg/12.6.0/lib/compat/wordpress-5.9/widget-render-api-endpoint/index.php

Gutenberg, version 12.6.0. 23 lines.

- Page: https://pluginprobe.com/plugins/gutenberg/12.6.0/code/lib/compat/wordpress-5.9/widget-render-api-endpoint/index.php
- Raw: https://pluginprobe.com/plugins/gutenberg/12.6.0/raw/lib/compat/wordpress-5.9/widget-render-api-endpoint/index.php
- Modified: 2022-02-16T23:10:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/gutenberg/12.6.0/code/lib/compat/wordpress-5.9/widget-render-api-endpoint/index.php#L10-L20`.

```php
<?php
/**
 * Shims the /wp/v2/widget-types/<id>/render endpoint in WP versions where it's missing
 *
 * @package gutenberg
 */

// Load the polyfill class.
require_once __DIR__ . '/class-gb-rest-widget-render-endpoint-polyfill.php';

/**
 * Registers routes from the GB_REST_Widget_Render_Endpoint_Polyfill class.
 */
function setup_widget_render_api_endpoint_polyfill() {
	$polyfill = new GB_REST_Widget_Render_Endpoint_Polyfill();
	$polyfill->register_routes();
}

// Priority should be larger than 99 which is the one used for registering the core routes.
add_action( 'rest_api_init', 'setup_widget_render_api_endpoint_polyfill', 100 );



```
