WP_REST_Widget_Types_Controller::render()publicWP 5.9.0

Renders a single Legacy Widget and wraps it in a JSON-encodable array.

{} It's a method of the class: WP_REST_Widget_Types_Controller{}

No Hooks.

Return

Array. An array with rendered Legacy Widget HTML.

Usage

$WP_REST_Widget_Types_Controller = new WP_REST_Widget_Types_Controller();
$WP_REST_Widget_Types_Controller->render( $request );
$request(WP_REST_Request) (required)
Full details about the request.

Changelog

Since 5.9.0 Introduced.

Code of WP_REST_Widget_Types_Controller::render() WP 6.0

public function render( $request ) {
	return array(
		'preview' => $this->render_legacy_widget_preview_iframe(
			$request['id'],
			isset( $request['instance'] ) ? $request['instance'] : null
		),
	);
}