`/wp/v2/menu-items`

Namespace: wp/v2
Route: /wp/v2/menu-items

Routes

  • Collection: /wp/v2/menu-items
  • Single: /wp/v2/menu-items/{id}

HTTP Methods

Collection methods: Unknown

Single methods: GET, POST, PUT, PATCH, DELETE

Request Parameters

Single GET

ParameterTypeRequiredDefaultDescription
idintegerfalseUnique identifier for the post.
contextstringfalseviewScope under which the request is made; determines fields present in response.

Single POST, PUT, PATCH

ParameterTypeRequiredDefaultDescription
idintegerfalseUnique identifier for the post.
titlestring, objectfalseThe title for the object.
typestringfalseThe family of objects originally represented, such as "post_type" or "taxonomy".
statusstringfalseA named status for the object.
parentintegerfalseThe ID for the parent of the object.
attr_titlestringfalseText for the title attribute of the link element for this menu item.
classesarrayfalseClass names for the link element of this menu item.
descriptionstringfalseThe description of this menu item.
menu_orderintegerfalseThe DB ID of the nav_menu_item that is this item’s menu parent, if any, otherwise 0.
objectstringfalseThe type of object originally represented, such as "category", "post", or "attachment".
object_idintegerfalseThe database ID of the original object this menu item represents, for example the ID for posts or the term_id for categories.
targetstringfalseThe target attribute of the link element for this menu item.
urlstringfalseThe URL to which this menu item points.
xfnarrayfalseThe XFN relationship expressed in the link of this menu item.
menusintegerfalseThe terms assigned to the object in the nav_menu taxonomy.
metaobjectfalseMeta fields.

Single DELETE

ParameterTypeRequiredDefaultDescription
idintegerfalseUnique identifier for the post.
forcebooleanfalseFalseWhether to bypass Trash and force deletion.

Response Schema (Item)

Schema not available.

Authentication

  • Read/Write: edit_theme_options.

Example Requests

bash
curl -X GET "https://wordpress.org/news/wp-json/wp/v2/menu-items"
bash
curl -X GET "https://wordpress.org/news/wp-json/wp/v2/menu-items/1"

Example Response (trimmed)

json
{
  "id": 1,
  "_links": {
    "self": [{ "href": "/wp/v2/menu-items/1" }]
  }
}