WP REST Menus

WP REST Menus

Wordpress plugin

Install on Wordpress

App Details

This plugin adds new endpoints for WordPress registered menus.
Usefull when building SPAs with Vuejs, React or any front-end framework.
Works with Advacned Custom Fields, WPML, Polylang

The new endpoints available:

Get all menus

GET /menus/v1/menus // Response sample { term_id: 2, name: "Main Menu", slug: "main-menu", term_group: 0, term_taxonomy_id: 2, taxonomy: "nav_menu", description: "", parent: 0, count: 8, filter: "raw" }, ... 

Get a menus items by id (term_id)

GET /menus/v1/menus/<id> // Response sample { ID: 5, post_author: "1", post_date: "2018-07-03 06:42:18", post_date_gmt: "2018-07-03 06:42:18", filter: "raw", db_id:5, menu_item_parent: "0", object_id: "5", object: "custom", type: "custom", type_label: "Custom Link", title: "Home", url: "https:\/\/wp-rest-menu.local\/", target: "", attr_title: "", description: "", classes: [ "" ], xfn: "", meta: null }, ... 

Get all menu locations
All menu locations assigned in /wp-admin/nav-menus.php?action=locations

GET /menus/v1/menus/locations is deprecated and will be removed in newer versions use: GET /menus/v1/locations // Response example { slug: "top", description: "Top Menu" }, { slug: "social", description: "Social Links Menu" } ... 

Get all menu location items
All menu locations assigned in /wp-admin/nav-menus.php?action=locations

GET /menus/v1/menus/locations/<slug> is deprecated and will be removed in newer versions use: GET /menus/v1/locations/<slug> // Response samexampleple { ID: 5, post_author: "1", post_date: "2018-07-03 06:42:18", post_date_gmt: "2018-07-03 06:42:18", filter: "raw", db_id:5, menu_item_parent: "0", object_id: "5", object: "custom", type: "custom", type_label: "Custom Link", title: "Home", url: "https:\/\/wp-rest-menu.local\/", target: "", attr_title: "", description: "", classes: [ "" ], xfn: "", meta: null }, ... 

There are two filters availiable:

Fields Filter

// it will return only the fields specified GET /menus/v1/menus/<id>/?fields=ID,title,meta // Response sample // Response sample { ID: 5, title: "Home", meta: null }, ... 

Nested Items Filter

// it will return menu items parents and nested children in a 'children' field // Currently only one level deep is supported GET /menus/v1/menus/<id>/?nested=1 // Response sample { ID: 1716, menu_item_parent: "0", object_id: "174", object: "page", title: "Level 1", meta: { vue_component: "LevelComponent", menu-item-field-01: "Field 1 value", menu-item-field-02: "Field 2 value" }, children:[ { ID: 1717, menu_item_parent: "1716", object_id: "744", object: "page", title: "Level 2b", meta : { vue_component: null } }, ... ] }, ... 

WP filter hooks

This plugin is quite configurable and provides lots of wp filter hooks from returned data in responses for each endpoint to params validation and endpoint permissions.

add_filter( 'wprm/get_menus/wp_get_nav_menus/args', 'my_wp_get_nav_menus', 10, 1 ); (used in GET /menus/v1/menus) function my_wp_get_nav_menus( $args ) { // do something with wp_get_nav_menus $args array return $args; } add_filter( 'wprm/get_menus', 'my_get_menus', 10, 1 ); (used in GET /menus/v1/menus) function my_get_menus( $menus ) { // do something with $menus array return $menus; // WP_Error|WP_HTTP_Response|WP_REST_Response|mixed } add_filter( 'wprm/get_menu_locations', 'my_get_menu_locations', 10, 1 ); (used in GET /menus/v1/locations) function my_get_menu_locations( $locations ) { // You can modify the $locations array response (get_registered_nav_menus()) return $locations; // WP_Error|WP_HTTP_Response|WP_REST_Response|mixed } add_filter( 'wprm/get_menu_items', 'my_get_menu_items', 10, 1 ); (used in GET /menus/v1/menus/<id>) function my_rest_menu_item_fields( $menu ) { // You can modify the $menu items return $menu; } add_filter( 'wprm/get_location_menu_items', 'my_get_location_menu_items', 10, 1 ); (used in GET /menus/v1/menus/<id>) function my_get_location_menu_items( $menu ) { // You can modify the locations $menu items return $menu; } add_filter( 'wprm/get_item_fields/filter_fields', 'my_filter_fields', 10, 1 ); (used to filter return field -node edges-) function my_filter_fields( $fields ) { // You can modify the $fields array so // you can filter the return fields for all endpoints // without using the url param ?fields $fields = array( 'ID', 'title' ); return $fields; } 

More filters

apply_filters('wprm/get_menus/permissions', '__return_true', $request ); apply_filters('wprm/get_menu_locations/permissions', '__return_true', $request ); apply_filters('wprm/get_menu_items/permissions', '__return_true', $request ); apply_filters('wprm/get_menu_items/validate/args/id', is_numeric( $param ), $param, $request, $key ); apply_filters('wprm/get_menu_items/validate/args/fields', is_string( $param ), $param, $request, $key ); apply_filters('wprm/get_menu_items/validate/args/nested', absint( $param ), $param, $request, $key ); apply_filters('wprm/get_location_menu_items/permissions', '__return_true', $request ); apply_filters('wprm/get_location_menu_items/validate/args/slug', is_string( $param ), $param, $request, $key ); apply_filters('wprm/get_location_menu_items/validate/args/fields', is_string( $param ), $param, $request, $key ); apply_filters('wprm/get_location_menu_items/validate/args/nested', absint( $param ), $param, $request, $key ); apply_filters('wprm/get_location_menu_items/permissions', '__return_true', $request ); apply_filters('wprm/get_location_menu_items/validate/args/slug', is_string( $param ), $param, $request, $key ); apply_filters('wprm/get_location_menu_items/validate/args/fields', is_string( $param ), $param, $request, $key ); apply_filters('wprm/get_location_menu_items/validate/args/nested', absint( $param ), $param, $request, $key ); 

Supports custom fields and Advanced Custom Fields
If ACF is installed the response node edge is acf else meta
In newer version these two edges will co exist and the plugin will separate natively registered custom fields ad acf registered ones.

Pricing

Starting from $0 per month.

Check Out the Team Members Blobs Widget

By Common Ninja

Team Members BlobsTry For Free!

App Info

Rating

Reviewers

4 reviews

Tags

api
v2
wp-rest-api

Developed By

skapator

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Maps

Maps plugins for Wordpress

Translation

Translation plugins for Wordpress

Chat

Chat plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Contact

Contact plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Forms

Forms plugins for Wordpress

Comments

Comments plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Comments

Comments plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Video Player

Video Player plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Security

Security plugins for Wordpress

Ads

Ads plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Membership

Membership plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Team Members Blobs for Wordpress logo

Team Members Blobs

Use team members blobs to present your staff in a clear, creative format that builds trust, supports transparency, and strengthens brand credibility.

Blogger Feed for Wordpress logo

Blogger Feed

Show Blogger posts automatically with a Blogger feed that keeps your content fresh, improves navigation, and helps visitors discover more of your work.

Coupon Bar for Wordpress logo

Coupon Bar

Display discounts with a coupon bar that highlights special offers, drives urgency, and helps convert visitors into paying customers.

Progress Circles for Wordpress logo

Progress Circles

Show progress with animated progress circles that visualize goals, display achievements, and keep visitors engaged.

Coupon Popup for Wordpress logo

Coupon Popup

Use a coupon popup to highlight special offers, capture email leads, reduce cart abandonment, and turn more visitors into paying customers.

Flash Cards for Wordpress logo

Flash Cards

Create interactive flash cards that present questions and answers in a clear, customizable format to support learning, training, and user engagement.

X Feed for Wordpress logo

X Feed

Show posts in an X feed that keeps updates visible, improves content discovery, and helps visitors stay engaged with your latest activity.

Creative Card Carousel for Wordpress logo

Creative Card Carousel

Showcase content with a creative card carousel that rotates banner style items to highlight offers and important messages.

Image Stack Gallery for Wordpress logo

Image Stack Gallery

Showcase photos with an image stack gallery that layers images in a stacked display with smooth transitions to create a visually striking presentation.

Social Proof for Wordpress logo

Social Proof

Show social proof that displays real user activity to build trust instantly, boost credibility, and help increase conversions across your site.

Medium Feed for Wordpress logo

Medium Feed

Show Medium articles in a Medium feed that keeps content fresh, improves readability, and helps visitors discover more posts.

Feedback Form for Wordpress logo

Feedback Form

Collect user insights with a feedback form that gathers valuable input, improves user experience, and helps you understand visitor needs more clearly.

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms