BACK TO DIRECTORY

WP-REST-API Menus

by jcdev518

0.0
(0 ratings)

This plugin adds “routes” or “endpoints” to WP REST API that allows for retrieval of
menu data as JSON.

Updated port of “WP-REST-API V2 Menus” by Claudio La Barbera (http://www.claudiolabarbera.com)

Usage

Get all registered menus:

GET /wp-menus/v1/menus
https://yourwpsite.com/wp-json/wp-menus/v1/menus

Get menu data as JSON from menu slug:

GET /wp-menus/v1/menus/{slug}
https://yourwpsite.com/wp-json/wp-menus/v1/menus/{slug}

Gets the contents of a registered menu by its “slug”.

When assigning a menu a location in /wp-admin/nav-menus.php?action=locations
the slug is the name of the menu in lowercase and without any spaces like a post slug.

If your menu name is Main Menu:
https://yourwpsite.com/wp-json/menus/v1/wp-menus/main-menu

Plugin Details

Active Installs
70
Total Downloads
2,913
Version
1.0
Requires WP
4.7.0
Requires PHP
5.6
Tested Up To
4.9.31
Added
2018-03-19
Last Updated
2018-03-26 10:33pm GMT

Ratings

5
0
4
0
3
0
2
0
1
0