All Projects → unfulvio → Wp Api Menus

unfulvio / Wp Api Menus

Licence: gpl-2.0
🔡 Menu routes for WordPress JSON REST API.

Labels

Projects that are alternatives of or similar to Wp Api Menus

Oblog
An Auto Rendering 🔽 Blogging System Based on MarkDown & Vue.js | 自动渲染装载 MarkDown 内容的博客系统
Stars: ✭ 133 (-5%)
Mutual labels:  wordpress
Graphql Api For Wp
[READ ONLY] GraphQL API for WordPress
Stars: ✭ 136 (-2.86%)
Mutual labels:  wordpress
Image Optimize Command
Easily optimize images using WP CLI
Stars: ✭ 138 (-1.43%)
Mutual labels:  wordpress
Wp Spider Cache
Your friendly neighborhood caching solution for WordPress
Stars: ✭ 133 (-5%)
Mutual labels:  wordpress
Gravity Forms Iframe
A Gravity Forms add-on to embed a form in an auto-resizing iframe on external sites.
Stars: ✭ 134 (-4.29%)
Mutual labels:  wordpress
React With Wordpress
🔥 Example of react application to access WordPress REST API
Stars: ✭ 137 (-2.14%)
Mutual labels:  wordpress
Voicewp
Create Alexa Skills through WordPress
Stars: ✭ 132 (-5.71%)
Mutual labels:  wordpress
Google Docs Add On
Publish to WordPress from Google Docs
Stars: ✭ 140 (+0%)
Mutual labels:  wordpress
Base Camp
Awesome WordPress starter theme for developers based on modern web technologies.
Stars: ✭ 135 (-3.57%)
Mutual labels:  wordpress
Wprecon
WPrecon (WordPress Recon), is a vulnerability recognition tool in CMS Wordpress, developed in Go and with scripts in Lua.
Stars: ✭ 135 (-3.57%)
Mutual labels:  wordpress
Fly Dynamic Image Resizer
Fly Dynamic Image Resizer plugin for WordPress
Stars: ✭ 133 (-5%)
Mutual labels:  wordpress
Hrcloud2
A full-featured home hosted Cloud Drive, Personal Assistant, App Launcher, File Converter, Streamer, Share Tool & More!
Stars: ✭ 134 (-4.29%)
Mutual labels:  wordpress
Fragment Cache
WordPress plugin for partial and async caching.
Stars: ✭ 135 (-3.57%)
Mutual labels:  wordpress
Vip Coding Standards
PHP_CodeSniffer ruleset to enforce WordPress.com VIP and VIP Go coding standards
Stars: ✭ 133 (-5%)
Mutual labels:  wordpress
Core
All of the required core code
Stars: ✭ 139 (-0.71%)
Mutual labels:  wordpress
Sempress
A highly semantic WordPress Theme with HTML5 templates, responsive and seo optimized. SemPress supports most of the new HTML5 tags, the new HTML5 input-types, microformats, microformats v2 and microdata (Schema.org).
Stars: ✭ 132 (-5.71%)
Mutual labels:  wordpress
Wp Tailwind
A WordPress starter theme that utilizes Tailwind + PurgeCSS.
Stars: ✭ 135 (-3.57%)
Mutual labels:  wordpress
Setup Ghost Blog
Script to install your own Ghost blog, with Nginx and ModSecurity/Naxsi web application firewall. Supports multiple blogs.
Stars: ✭ 140 (+0%)
Mutual labels:  wordpress
Health Check
Health Check is a WordPress plugin that will perform a number of checks on your WordPress install to detect common configuration errors and known issues.
Stars: ✭ 139 (-0.71%)
Mutual labels:  wordpress
Wordpress Scanner
Wordpress Vulnerability Scanner
Stars: ✭ 137 (-2.14%)
Mutual labels:  wordpress

Menu routes for WordPress JSON REST API

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 V1 data arrangement of each individual menu items and children using the filter hook json_menus_format_menu_item.

WP API V2

In V1 of the REST API the routes are located by default at wp-json/menus/ etc.

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.

You can alter the V2 data arrangement of the REST response using the filter hooks

  1. rest_menus_format_menus to alter the list of menu items returned (e.g from wp-json/wp-api-menus/v2/menus/)
  2. rest_menus_format_menu to alter a single menu returned (e.g wp-json/wp-api-menus/v2/menus/<id>)
  3. rest_menus_format_menu_item to alter the menu items returned (e.g wp-json/wp-api-menus/v2/menus/<id> items property)

Contributing

  • Submit a pull request or open a ticket here on GitHub.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].