WP_REST_Widget_Types_Controller::render() WordPress Method

The WP_REST_Widget_Types_Controller::render() method is responsible for rendering a Widget Type for display in the WordPress Administration.

WP_REST_Widget_Types_Controller::render( WP_REST_Request $request ) #

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


Parameters

$request

(WP_REST_Request)(Required)Full details about the request.


Top ↑

Return

(array) An array with rendered Legacy Widget HTML.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php

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


Top ↑

Changelog

Changelog
VersionDescription
5.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.