Title: WP API Menus
Author: Fulvio Notarstefano
Published: <strong>जनवरी 18, 2015</strong>
Last modified: अगस्ट 18, 2020

---

प्लगिनहरू खोज्नुहोस्

![](https://ps.w.org/wp-api-menus/assets/banner-772x250.png?rev=1070279)

यो प्लगिन **वर्डप्रेसका ३ प्रमुख नवीनतम रिलीजहरूसँग परीक्षण गरिएको छैन**। यो अब 
सम्भवतः व्यवस्थित वा समर्थन नभएको हुन सक्छ र वर्डप्रेसका नयाँ संस्करणहरूमा प्रयोग
गर्दा अनुकूलता सम्बन्धी समस्या हुन सक्छ।

![](https://ps.w.org/wp-api-menus/assets/icon-256x256.png?rev=1070279)

# WP API Menus

 [Fulvio Notarstefano](https://profiles.wordpress.org/nekojira/) द्वारा

[डाउनलोड गर्नुहोस्](https://downloads.wordpress.org/plugin/wp-api-menus.1.3.2.zip)

 * [विवरण](https://ne.wordpress.org/plugins/wp-api-menus/#description)
 * [समीक्षाहरू](https://ne.wordpress.org/plugins/wp-api-menus/#reviews)
 *  [स्थापना](https://ne.wordpress.org/plugins/wp-api-menus/#installation)
 * [विकास](https://ne.wordpress.org/plugins/wp-api-menus/#developers)

 [सहायता](https://wordpress.org/support/plugin/wp-api-menus/)

## विवरण

This plugin extends the [WordPress JSON REST API](https://wordpress.org/plugins/json-rest-api/)
with new routes for WordPress registered menus

The new routes available will be:

 * `/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`.

**An important note on WP API V2:**

In V1 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.

## स्थापना

This plugin requires having [WP API](https://wordpress.org/plugins/json-rest-api/)
installed and activated or it won’t be of any use.

Install the plugin as you would with any WordPress plugin in your `wp-content/plugins/`
directory or equivalent.

Once installed, activate WP API Menus from WordPress plugins dashboard page and 
you’re ready to go, WP API will respond to new routes and endpoints to your registered
menus.

## प्रश्नोत्तर

### Is this an official extension of WP API?

There’s no such thing.

### Will this plugin do ‘X’ ?

You can submit a pull request to:
 https://github.com/unfulvio/wp-api-menus However,
menu data organization in json is a bit arbitrary and subjective, and that’s why
probably hasn’t made it into WP API by the time of writing. You could also fork 
this plugin altogether and write your json output for a specific use case.

## समीक्षाहरू

![](https://secure.gravatar.com/avatar/182462837aef96801eeb82db0fe06897b96c94d87deea4efca6bda486d68d476?
s=60&d=retro&r=g)

### 󠀁[nice](https://wordpress.org/support/topic/nice-3892/)󠁿

 [faizahmaddae](https://profiles.wordpress.org/faizahmaddae/) मार्च 30, 2021

i like it

![](https://secure.gravatar.com/avatar/12cf6a7107d4094e0db4fa9245e0b6c887a86a435daa391ba7db3d30602f7180?
s=60&d=retro&r=g)

### 󠀁[Thanks for plugin](https://wordpress.org/support/topic/thanks-for-plugin-19/)󠁿

 [Aphagon](https://profiles.wordpress.org/vilet224/) जनवरी 19, 2021

Thanks for plugin.

![](https://secure.gravatar.com/avatar/df07c87083bb61d4afa7e3f09964723f4fb6a8174a7a08fcf77cd0afc1270328?
s=60&d=retro&r=g)

### 󠀁[It Does!](https://wordpress.org/support/topic/it-does-2/)󠁿

 [James Bradford](https://profiles.wordpress.org/arniebradfo/) फेब्रुअरी 11, 2018

Says what it does and does what it says!

![](https://secure.gravatar.com/avatar/7703ac498eb14625dafc1dc8ef022899b380ee468fa4010e30e6be032ad7a889?
s=60&d=retro&r=g)

### 󠀁[Good job](https://wordpress.org/support/topic/good-job-454/)󠁿

 [webstyle](https://profiles.wordpress.org/webstyle/) सेप्टेम्बर 3, 2016 1 जवाफ

Works well. Thank you!

![](https://secure.gravatar.com/avatar/8cde304898b8cfeb216a6ab6d9bc0e87aa677f4effcf54478d1989ef595c1705?
s=60&d=retro&r=g)

### 󠀁[Just what I needed](https://wordpress.org/support/topic/just-what-i-needed-416/)󠁿

 [wLc Designs](https://profiles.wordpress.org/ejbliss/) सेप्टेम्बर 3, 2016 1 जवाफ

Awesome. This is just what I needed for my React project.

 [ सबै 8 समीक्षाहरू पढ्नुहोस् ](https://wordpress.org/support/plugin/wp-api-menus/reviews/)

## योगदानकर्ता र डेभलपरहरू

“WP API Menus” खुला स्रोत सफ्टवेयर हो। निम्न व्यक्तिहरूले यो प्लगिनमा योगदान गरेका
छन्।

योगदानकर्ताहरू

 *   [ Fulvio Notarstefano ](https://profiles.wordpress.org/nekojira/)
 *   [ Austin ](https://profiles.wordpress.org/austyfrosty/)

[“WP API Menus” लाई आफ्नो भाषामा अनुवाद गर्नुहोस्](https://translate.wordpress.org/projects/wp-plugins/wp-api-menus)

### विकासमा रुचि छ?

[आरएसएस](https://plugins.trac.wordpress.org/log/wp-api-menus/?limit=100&mode=stop_on_copy&format=rss)
द्वारा [कोड ब्राउज गर्नुहोस्](https://plugins.trac.wordpress.org/browser/wp-api-menus/),
[एसभीएन रिपजिटरी](https://plugins.svn.wordpress.org/wp-api-menus/) हेर्नुहोस्, वा
[विकास लग](https://plugins.trac.wordpress.org/log/wp-api-menus/) को सदस्यता लिनुहोस्।

## चेन्जलग

#### 1.3.2

 * Fix: Address V2 register_rest_route compatibility issue with WP 5.5 (missing 
   permission_callback arg) – props @thefrosty

#### 1.3.1

 * Tweak: The `object_slug` property is now available to get the slug for relative
   URLs – props @Fahrradflucht

#### 1.3.0

 * Fix (V2): Nodes duplication in sublevel menu items, see https://github.com/unfulvio/
   wp-api-menus/pull/22 – props @bpongvh
 * Fix (V2): The items array was empty because it was looking for “ID” key instead
   of “id” – props @Dobbler
 * Fix (V1): Check for JSON_API_VERSION constant, as in a mu-plugin installation
   of WP API 1.0 it will not show up under active_plugins – props @pdufour

#### 1.2.1

 * Tweak (V2 only): Use lowercase `id` instead of uppercase `ID` in API responses,
   to match the standard lowercase `id` used across WP REST API – props @puredazzle
 * Fix: Fixed WP API v1 version detection for WordPress 4.4 – props Thomas Chille

#### 1.2.0

 * Enhancement: Added WP REST API v2 support – props @foxpaul
 * Misc: Supports WordPress 4.3

#### 1.1.5

 * Misc: Minor edits to headers and phpdocs
 * Misc: Improved security

#### 1.1.4

 * Misc: Supports WordPress 4.2, add composer.json for wp-packagist

#### 1.1.3

 * Fix: Fixes bug where duplicate items where created in nested menus – props @josh-
   taylor

#### 1.1.2

 * Tweak: Introduced `json_menus_format_menu_item` filter hook – props @Noctine

#### 1.1.1

 * Misc: Submission to WordPress.org plugins directory.

#### 1.1.0

 * Enhancement: Routes for menus in theme locations now include complete tree with
   item order and nested children
 * Tweak: `description` attribute for individual items is now included in results
 * Fix: Fixed typo confusing `parent` with `collection` in meta

#### 1.0.0

 * First public release

## मेटा

 *  संस्करण **1.3.2**
 *  पछिल्लो अपडेट **6 वर्ष अघि**
 *  सक्रिय स्थापना **2,000+**
 *  वर्डप्रेस संस्करण ** 3.6.0 वा उच्च **
 *  जाँच गरिएको **5.5.0**
 *  भाषा
 * [English (US)](https://wordpress.org/plugins/wp-api-menus/)
 * ट्यागहरू
 * [JSON](https://ne.wordpress.org/plugins/tags/json/)[json rest api](https://ne.wordpress.org/plugins/tags/json-rest-api/)
   [menus](https://ne.wordpress.org/plugins/tags/menus/)[wp-api](https://ne.wordpress.org/plugins/tags/wp-api/)
   [wp-rest-api](https://ne.wordpress.org/plugins/tags/wp-rest-api/)
 *  [उन्नत दृश्य](https://ne.wordpress.org/plugins/wp-api-menus/advanced/)

## रेटिङ्गहरू

 ५ मा 5 तारा।

 *  [  8 5-तारा समीक्षाहरू     ](https://wordpress.org/support/plugin/wp-api-menus/reviews/?filter=5)
 *  [  0 4-तारा समीक्षाहरू     ](https://wordpress.org/support/plugin/wp-api-menus/reviews/?filter=4)
 *  [  0 3-तारा समीक्षाहरू     ](https://wordpress.org/support/plugin/wp-api-menus/reviews/?filter=3)
 *  [  0 2-तारा समीक्षाहरू     ](https://wordpress.org/support/plugin/wp-api-menus/reviews/?filter=2)
 *  [  0 1-तारा समीक्षाहरू     ](https://wordpress.org/support/plugin/wp-api-menus/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wp-api-menus/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/wp-api-menus/reviews/)

## योगदानकर्ताहरू

 *   [ Fulvio Notarstefano ](https://profiles.wordpress.org/nekojira/)
 *   [ Austin ](https://profiles.wordpress.org/austyfrosty/)

## सहायता

केही भन्नु छ? सहयोग चाहियो?

 [सहायता फोरम हेर्नुहोस्](https://wordpress.org/support/plugin/wp-api-menus/)

## दान गर्नुहोस्

के तपाईँ यस प्लगिनको उन्नतिको लागि सहायता गर्न चाहनुहुन्छ?

 [ यो प्लगिनको लागि दान गर्नुहोस् ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=P64V9NTEYFKDL)