getWidget
Retrieve a specific widget by its ID to view metadata and optionally its HTML, CSS, and JavaScript code for editing or auditing.
Instructions
Get a single widget - Fetch a single widget record by widget_id. Read-only.
Lean-by-default keep-list: returns only widget_id, widget_name, widget_type, widget_viewport, short_code, date_updated, revision_timestamp, is_default. The code fields (widget_data, widget_style, widget_javascript) are stripped — restore with include_code=1.
Use when: you have a widget_id (from listWidgets or admin) and want the widget's SOURCE code to edit or audit. To preview the rendered widget on the front-end, embed it on a page via [widget=Name] shortcode and view the page.
Required: widget_id (path parameter).
See also: listWidgets (enumerate), updateWidget (modify).
Returns: { status: "success", message: [{...record}] } - the message array contains 1 record with all widget fields (widget_data = HTML, widget_style = CSS, widget_javascript = JS, plus metadata).
For the full field list, see listWidgets.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| widget_id | Yes | ||
| include_code | No | Opt in to return `widget_data`, `widget_style`, `widget_javascript` (the HTML/CSS/JS). Default stripped. Needed before `updateWidget` edits to the code. |