Giter Site home page Giter Site logo

humanmade / wp-api-menus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from unfulvio/wp-api-menus

3.0 13.0 4.0 202 KB

:abcd: Menu routes for WordPress JSON REST API.

Home Page: https://wordpress.org/plugins/wp-api-menus

License: GNU General Public License v2.0

JavaScript 19.87% PHP 80.13%

wp-api-menus's Introduction

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:

  • /menus list of every registered menu.
  • /menus/<id> data for a specific menu.
  • /menu-locations list of all registered theme locations.
  • /menu-locations/<location> data for menu in specified menu in theme location.

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

  • Submit a pull request or open a ticket here on GitHub.

wp-api-menus's People

Contributors

dobbler avatar fahrradflucht avatar gitter-badger avatar josh-taylor avatar mattheu avatar pdufour avatar puredazzle avatar tdlm avatar unfulvio avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.