Get navigation menu as post type
-
I’m trying to get the navigation menu as JSON data.
From WordPress codex: navigation menu is treated as a post type.
From Rest API Doc, this is how we get posts of a type:
GET https://demo.wp-api.org/wp-json/wp/v2/types/<type>
I tried to get it like so:
URL : https://localhost/wptest/wp-json/wp/v2/types/nav_menu_item
I received 403 error.
{"code":"rest_cannot_read_type","message":"Cannot view type.","data":{"status":403}}
the server understood my request but it refused to give the data.
Q: How can I fix this?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get navigation menu as post type’ is closed to new replies.