humanmade/wp-api-menus

Name: wp-api-menus

Owner: Human Made

Description: :abcd: Menu routes for WordPress JSON REST API.

Forked from: unfulvio/wp-api-menus

Created: 2017-03-21 11:56:21.0

Updated: 2017-04-12 20:02:00.0

Pushed: 2017-03-21 15:12:05.0

Homepage: https://wordpress.org/plugins/wp-api-menus

Size: 202

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Human Made menu routes for WordPress JSON REST API

This is a fork of the menu routes for WordPressJSON REST API plugin.

Human Made GitHub version GitHub version Scrutinizer Code Quality Join the chat at https://gitter.im/unfulvio/wp-api-menus

WordPress plugin that extends the JSON REST WP API with new routes pointing to WordPress registered menus. Read the WP API documentation.

Download from WordPress.org

New routes available:

Currently, the menu-locations/<location> route for individual menus will return a tree with full menu hierarchy, with correct menu item order and listing children for each menu item. The menus/<id> route will output menu details and a flat array of menu items. Item order or if each item has a parent will be indicated in each item attributes, but this route won't output items as a tree.

You can alter the data arrangement of each individual menu items and children using the filter hook json_menus_format_menu_item.

WP API V2

In V2 the routes by default are at wp-json/wp-api-menus/v2/ (e.g. wp-json/wp-api-menus/v2/menus/, etc.) since V2 encourages prefixing and version namespacing.

Contributing

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.