WP_REST_Widget_Types_Controller::render() – Renders a single Legacy Widget and wraps it in a JSON-encodable array.

You appear to be a bot. Output may be restricted

Description

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

Usage

$array = WP_REST_Widget_Types_Controller::render( $request );

Parameters

$request
( WP_REST_Request ) required – Full details about the request.

Returns

array An array with rendered Legacy Widget HTML.

Source

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


Lines:

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

 View on GitHub View on Trac