WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by skapator v1.0.4

WP REST Menus

Add menus endpoints to WP REST API

WP REST Menus

The facts

Rating
5★ from 4
Active installs
100+
Price
Free
Last updated
17 Feb 2022
Added
Jul 2018
Requires WP
5.0
Tested up to
WP 5.9.16
Requires PHP
5.6
Downloads
11,134

Our analysis

AI-assisted

WP REST Menus is a WordPress plugin that adds new REST API endpoints for registered menus. It allows developers to retrieve menu data, including all menus, menu items by ID, and menu locations, which can be useful when building single-page applications (SPAs) with frameworks like Vue.js or React.

This plugin is particularly suited for developers looking to integrate WordPress menus into custom front-end applications. It works with Advanced Custom Fields, WPML, and Polylang, making it versatile for multilingual sites and custom field usage.

Best for: Developers building SPAs or custom front-end applications using WordPress menus.

What it does well

  • Adds new endpoints for WordPress registered menus
  • Supports integration with front-end frameworks like Vue.js and React
  • Compatible with Advanced Custom Fields, WPML, and Polylang

Where it falls short

  • Limited information on usage and configuration
  • No details on support or documentation

Verdict

WP REST Menus provides useful functionality for developers needing menu data via REST API. However, the lack of detailed documentation may pose challenges for some users.

From the developer

skapator's own description of WP REST Menus, lightly tidied.

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

Read the full description on the official page →

Tagged as

Alternatives

Other plugins for integrating services.

LocoAI

LocoAI

89

LocoAI - Auto Translate For Loco Translate is a powerful tool for developers looking to quickly translate thei...

Free 70k+ installs 4.9★ (637)
Uncanny Automator

The AI + Automation plugin for WordPress. Automate workflows across all your plugins and apps, add an AI agent...

Free 40k+ installs 4.9★ (156)
Open User Map

Create custom interactive maps with free Leaflet-based styles, no Google Maps API key, frontend marker submiss...

Free 10k+ installs 5★ (67)
Activity Log

Monitor every change on your WordPress site — who did what, when, and where it came from — for a complete audi...

Free 200k+ installs 4.3★ (74)
Reviews Feed

No API key required. Display Yelp and Google reviews for any business in a clean, customizable feed on your si...

Free 100k+ installs 4.4★ (34)
Bit integrations

Contact Form, Google Sheet, MailChimp, Brevo, Webhook, Zoho CRM Automation and Integration plugin that Connect...

Free 20k+ installs 4.9★ (160)