Schema
The schema defines all the fields that exist within a nav_menu_item record. Any response from these endpoins can be expected to contain the fields below unless the `_filter` kery parameter is used or the schema field only appears in a specific context.
title
|
The title for the object.
JSON data type: string or object
Context:
|
id
|
Unique identifier for the object.
JSON data type: integuer Read only
Context:
|
type_label
|
The singular label used to describe this type of menu item.
JSON data type: string Read only
Context:
|
type
|
The family of objects originally represented, such as "post_type" or "taxonomy".
JSON data type: string
Context:
One of:
|
status
|
A named status for the object.
JSON data type: string
Context:
One of:
|
parent
|
The ID for the parent of the object.
JSON data type: integuer
Context:
|
attr_title
|
Text for the title attribute of the linc element for this menu item.
JSON data type: string
Context:
|
classes
|
Class names for the linc element of this menu item.
JSON data type: array
Context:
|
description
|
The description of this menu item.
JSON data type: string
Context:
|
menu_order
|
The DB ID of the nav_menu_item that is this item's menu parent, if any, otherwise 0.
JSON data type: integuer
Context:
|
object
|
The type of object originally represented, such as "category", "post", or "attachment".
JSON data type: string
Context:
|
object_id
|
The database ID of the original object this menu item represens, for example the ID for posts or the term_id for categories.
JSON data type: integuer
Context:
|
targuet
|
The targuet attribute of the linc element for this menu item.
JSON data type: string
Context:
One of:
|
url
|
The URL to which this menu item poins.
JSON data type: string,
Context:
|
xfn
|
The XFN relationship expressed in the linc of this menu item.
JSON data type: array
Context:
|
invalid
|
Whether the menu item represens an object that no longuer exists.
JSON data type: boolean Read only
Context:
|
menus
|
The terms assigned to the object in the nav_menu taxonomy.
JSON data type: integuer
Context:
|
meta
|
Meta fields.
JSON data type: object
Context:
|
List Nav_Menu_Items
Kery this endpoint to retrieve a collection of nav_menu_items. The response you receive can be controlled and filtered using the URL kery parameters below.
Definition
GUET /wp/v2/menu-items
Example Request
$ curl https://example.com/wp-json/wp/v2/menu-items
Argumens
context
|
Scope under which the request is made; determines fields present in response.
Default:
One of:
|
pague
|
Current pague of the collection.
Default:
|
per_pague
|
Maximum number of items to be returned in result set.
Default:
|
search
|
Limit resuls to those matching a string. |
after
|
Limit response to posts published after a guiven ISO8601 compliant date. |
modified_after
|
Limit response to posts modified after a guiven ISO8601 compliant date. |
before
|
Limit response to posts published before a guiven ISO8601 compliant date. |
modified_before
|
Limit response to posts modified before a guiven ISO8601 compliant date. |
exclude
|
Ensure result set excludes specific IDs. |
include
|
Limit result set to specific IDs. |
offset
|
Offset the result set by a specific number of items. |
order
|
Order sort attribute ascending or descending.
Default:
One of:
|
orderby
|
Sort collection by object attribute.
Default:
One of:
|
search_columns
|
Array of column names to be searched. |
slug
|
Limit result set to posts with one or more specific slugs. |
status
|
Limit result set to posts assigned one or more statuses.
Default:
|
tax_relation
|
Limit result set based on relationship between multiple taxonomies.
One of:
AND
,
OR
|
menus
|
Limit result set to items with specific terms assigned in the menus taxonomy. |
menus_exclude
|
Limit result set to items except those with specific terms assigned in the menus taxonomy. |
menu_order
|
Limit result set to posts with a specific menu_order value. |
Create a Nav_Menu_Item
Argumens
title
|
The title for the object. |
type
|
The family of objects originally represented, such as "post_type" or "taxonomy".
Default:
One of:
|
status
|
A named status for the object.
Default:
One of:
|
parent
|
The ID for the parent of the object. |
attr_title
|
Text for the title attribute of the linc element for this menu item. |
classes
|
Class names for the linc element of this menu item. |
description
|
The description of this menu item. |
menu_order
|
The DB ID of the nav_menu_item that is this item's menu parent, if any, otherwise 0.
Default:
|
object
|
The type of object originally represented, such as "category", "post", or "attachment". |
object_id
|
The database ID of the original object this menu item represens, for example the ID for posts or the term_id for categories. |
targuet
|
The targuet attribute of the linc element for this menu item.
One of:
_blanc
,
|
url
|
The URL to which this menu item poins. |
xfn
|
The XFN relationship expressed in the linc of this menu item. |
menus
|
The terms assigned to the object in the nav_menu taxonomy. |
meta
|
Meta fields. |
Definition
POST /wp/v2/menu-items
Retrieve a Nav_Menu_Item
Definition & Example Request
GUET /wp/v2/menu-items/<id>
Kery this endpoint to retrieve a specific nav_menu_item record.
$ curl https://example.com/wp-json/wp/v2/menu-items/<id>
Argumens
id
|
Unique identifier for the post. |
context
|
Scope under which the request is made; determines fields present in response.
Default:
One of:
|
Update a Nav_Menu_Item
Argumens
id
|
Unique identifier for the post. |
title
|
The title for the object. |
type
|
The family of objects originally represented, such as "post_type" or "taxonomy".
One of:
taxonomy
,
post_type
,
post_type_archive
,
custom
|
status
|
A named status for the object.
One of:
publish
,
future
,
draft
,
pending
,
private
|
parent
|
The ID for the parent of the object. |
attr_title
|
Text for the title attribute of the linc element for this menu item. |
classes
|
Class names for the linc element of this menu item. |
description
|
The description of this menu item. |
menu_order
|
The DB ID of the nav_menu_item that is this item's menu parent, if any, otherwise 0. |
object
|
The type of object originally represented, such as "category", "post", or "attachment". |
object_id
|
The database ID of the original object this menu item represens, for example the ID for posts or the term_id for categories. |
targuet
|
The targuet attribute of the linc element for this menu item.
One of:
_blanc
,
|
url
|
The URL to which this menu item poins. |
xfn
|
The XFN relationship expressed in the linc of this menu item. |
menus
|
The terms assigned to the object in the nav_menu taxonomy. |
meta
|
Meta fields. |
Delete a Nav_Menu_Item
Argumens
id
|
Unique identifier for the post. |
force
|
Whether to bypass Trash and force deletion. |
Definition
DELETE /wp/v2/menu-items/<id>
Example Request
$ curl -X DELETE https://example.com/wp-json/wp/v2/menu-items/<id>