wp_set_menu_items
Set a menu's items. items = JSON array of objects: {title, url?, type?:custom|page|post, object_id?, parent_index?}. Build DROPDOWNS with parent_index (0-based index into this list of the parent item). type='page' with object_id links to a page. replace (default true) clears existing items first. Writes-gated, Xyle Connector v0.6.0+.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | JSON array of {title, url?, type?, object_id?, parent_index?} | |
| menu_id | Yes | The menu id (from wp_create_menu / wp_list_menus) | |
| replace | No | Clear existing items first (default true) | |
| site_id | Yes | The WordPress site ID |