Menu Toolswordpress_create_menu

wordpress_create_menu

Create a new WordPress navigation menu.

wordpress_create_menu

Create a new navigation menu.

Parameters

2 parameters, 1 required.

NameTypeRequiredWhat it is
namestringyesMenu name
descriptionstringnoMenu description

Example call

The smallest valid call, with the required parameters only:

{
  "name": "wordpress_create_menu",
  "arguments": {
    "name": "Example title"
  }
}

Response

{
  "success": true,
  "id": 10,
  "name": "Primary Menu"
}

What it changes

It writes to the site. Respira takes a snapshot before the write, and the change can be undone from that snapshot for 90 days. Calling it twice does the work twice. On a connection set to read-only it is refused with respira_scope_denied.

How long it takes

A typical call takes about 2.1 seconds. 19 in 20 finish within 4.5 seconds. Measured on real sites over the last week, so it includes the site's own hosting.

Availability

Works on any WordPress site, whichever page builder it uses. Available since Respira 1.0.0.

Next Steps

After creating a menu, add items with wordpress_create_menu_item, then assign it to a location with wordpress_assign_menu_location.

Example Prompts

  • "Create a new menu called 'Footer Menu'"
  • "Create a menu named 'Resources'"