Create Widget (block)
wp_create_widgetAdd a block-based widget to a sidebar or widget area, such as a Kadence footer column, by providing the sidebar ID and block markup.
Instructions
Create a block-based widget in a sidebar/widget area. Use for populating Kadence footer columns. Requires admin.
Args:
sidebar (string): target widget-area ID (from wp_get_sidebars).
content (string): block markup for the widget body.
Returns: the created widget (incl. its new id).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Block markup for the widget body (e.g. '<!-- wp:heading -->...'). Creates a block-based widget. | |
| sidebar | Yes | Sidebar/widget-area ID to add the widget to (e.g. a Kadence footer area). Get IDs from wp_get_sidebars. | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable. | markdown |