Get Menu Items
Returns one classic menu with all its items as a nested tree: each item's label, what it links to, its address, its position among its siblings and its children. Read-only. It also flags broken items: links to pages that were deleted, trashed or are still drafts, links to deleted categories, and items left orphaned by an earlier deletion, including items WordPress hides from visitors. Use the item_id values it returns with mosmcp/menu-update-item, mosmcp/menu-remove-item and mosmcp/menu-reorder-items.
Also known as: show menu, menu items, what is in the menu, menu links, menu structure, broken menu links.
| Property | Value |
|---|---|
| Ability slug | mosmcp/menu-get |
| Wire tool name | mosmcp__menu-get |
| Category | Menus & Navigation (mosmcp-menus) |
| Plan | Free |
Required access
| Requirement | Value |
|---|---|
| Capability | edit_theme_options |
| Minimum default role | Administrator (Shop manager too when WooCommerce is active) |
| Annotations | readOnly: true · destructive: false · idempotent: true · openWorld: false |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| menu | integer | string | Yes | — | The menu: its numeric ID, its slug, or its name (for example 7, "main-menu" or "Main Menu"). The name of a theme location that has a menu assigned also works, for example "primary". |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| menu | object | Yes | |
| menu.menu_id | integer | Yes | Menu ID, accepted wherever a menu is asked for. |
| menu.name | string | Yes | |
| menu.slug | string | ||
| menu.description | string | ||
| menu.item_count | integer | Published items in the menu. | |
| menu.locations | string[] | Theme locations this menu is assigned to. Empty means the theme does not display it anywhere. | |
| menu.auto_add_pages | boolean | Whether WordPress adds every newly published top-level page to this menu automatically. | |
| item_count | integer | Every item, including ones hidden from visitors. | |
| max_depth | integer | ||
| items | object[] | Yes | Top-level items in display order, each with its children nested inside. |
| items[].item_id | integer | The menu item's own ID, which every other menu ability takes. It is not the ID of the linked page. | |
| items[].label | string | Text shown in the menu. | |
| items[].uses_linked_title | boolean | True when the item has no label of its own and shows the linked page or category title, so renaming that page renames the item too. | |
| items[].type | string | "post_type" (a page, post or other content), "taxonomy" (a category, tag or other term), "post_type_archive", or "custom" (a typed address). | |
| items[].type_label | string | What wp-admin calls it, for example "Page", "Category" or "Custom Link". | |
| items[].object | string | The linked content type or taxonomy, for example "page", "post" or "category"; "custom" for custom links. | |
| items[].object_id | integer | ID of the linked page, post or term; 0 for custom links and archives. | |
| items[].url | string | ||
| items[].open_in_new_tab | boolean | ||
| items[].css_classes | string[] | ||
| items[].description | string | Item description; only some themes display it. | |
| items[].title_attribute | string | Tooltip text shown when hovering the link. | |
| items[].link_rel | string | Link relationship, for example "nofollow". | |
| items[].parent_item_id | integer | Item this one is nested under; 0 for the top level. | |
| items[].position | integer | 1-based position among the items that share the same parent. | |
| items[].depth | integer | 0 for top-level items, 1 for their children, and so on. | |
| items[].linked_status | string | For page and post links, the linked item's status (publish, draft, private, trash...) or "missing"; for term and archive links "ok" or "missing"; empty for custom links. | |
| items[].shown_to_visitors | boolean | False when WordPress hides the item from visitors because what it links to is gone or trashed, or because the item itself was never saved. | |
| items[].children | object[] | Items nested under this one, in order. | |
| warnings | object[] | Broken or hidden items, each naming the item and how to fix it. | |
| warnings[].code | string | ||
| warnings[].message | string | ||
| warnings[].context | string | ||
| notes | string[] |
| << Previous | Next >> |
|---|---|
| Delete Menu | Get Navigation Menu |
For more information about the Secure MCP Server for WordPress plugin, explore the following resources:
Product Overview | Pricing | Try for Free | Documentation
If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.