Schema
The schema defines all the fields that exist within a nav_menu record. Any response from these endpoints can be expected to contain the fields below unless the `_filter` query parameter is used or the schema field only appears in a specific context.
id | Unique identifier for the term. JSON data type: integer Read only Context: |
description | HTML description of the term. JSON data type: string Context: |
name | HTML title for the term. JSON data type: string Context: |
slug | An alphanumeric identifier for the term unique to its type. JSON data type: string Context: |
meta | Meta fields. JSON data type: object Context: |
locations | The locations assigned to the menu. JSON data type: array Context: |
auto_add | Whether to automatically add top level pages to this menu. JSON data type: boolean Context: |
List Nav_Menus
Query this endpoint to retrieve a collection of nav_menus. The response you receive can be controlled and filtered using the URL query parameters below.
Definition
GET /wp/v2/menus
Example Request
$ curl https://example.com/wp-json/wp/v2/menus
Arguments
context | Scope under which the request is made; determines fields present in response. Default: One of: |
page | Current page of the collection. Default: |
per_page | Maximum number of items to be returned in result set. Default: |
search | Limit results to those matching a string. |
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 term attribute. Default: One of: |
hide_empty | Whether to hide terms not assigned to any posts. |
post | Limit result set to terms assigned to a specific post. |
slug | Limit result set to terms with one or more specific slugs. |
Definition
POST /wp/v2/menus
Retrieve a Nav_Menu
Definition & Example Request
GET /wp/v2/menus/<id>
Query this endpoint to retrieve a specific nav_menu record.
$ curl https://example.com/wp-json/wp/v2/menus/<id>
Arguments
id | Unique identifier for the term. |
context | Scope under which the request is made; determines fields present in response. Default: One of: |
Update a Nav_Menu
Arguments
id | Unique identifier for the term. |
description | HTML description of the term. |
name | HTML title for the term. |
slug | An alphanumeric identifier for the term unique to its type. |
meta | Meta fields. |
locations | The locations assigned to the menu. |
auto_add | Whether to automatically add top level pages to this menu. |
Delete a Nav_Menu
Arguments
id | Unique identifier for the term. |
force | Required to be true, as terms do not support trashing. |
Definition
DELETE /wp/v2/menus/<id>
Example Request
$ curl -X DELETE https://example.com/wp-json/wp/v2/menus/<id>