WP_REST_Widget_Types_Controller::render()
Renders a single Legacy Widget and wraps it in a JSON-encodable array.
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. |
WP_REST_Widget_Types_Controller::render() WP REST Widget Types Controller::render code WP 6.6.2
public function render( $request ) { return array( 'preview' => $this->render_legacy_widget_preview_iframe( $request['id'], isset( $request['instance'] ) ? $request['instance'] : null ), ); }