Add a menu item
wp_add_menu_itemAdd a published item to a navigation menu, at the end: a link to a post, page or entry of another post type when object_id is given, otherwise a custom link to url. Returns added and item_id. Each call adds a new item, also when one with the same target exists. A URL with a scheme WordPress does not allow in menus (javascript:, data:) is refused. Needs edit_theme_options. No undo point is recorded; wp_delete_menu_item removes an item. Forwarded by AlphaBridge Connect to the one site this connection reaches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Target of a custom link, e.g. https://example.com/, mailto:, tel: or a relative path. Ignored when object_id is given. | |
| menu | Yes | Menu id, slug or name, as wp_list_menus returns them. | |
| title | Yes | Label shown in the menu. | |
| object | No | Post type of object_id, e.g. page or post. Default "page". Only used with object_id. | |
| parent | No | item_id of the parent item, as wp_get_menu returns it, for a submenu entry. Default 0 (top level). | |
| object_id | No | Post/page id for a content link; its URL follows the post. |