WP_REST_Widget_Types_Controller::render( WP_REST_Request $request ): array

In this article

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

Parameters

$requestWP_REST_Requestrequired
Full details about the request.

Return

array An array with rendered Legacy Widget HTML.

Source

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

Changelog

VersionDescription
5.9.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.