這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

WP-REST-API Menus

描述

This plugin adds “routes” or “endpoints” to WP REST API that allows for retrieval of
menu data as JSON.

Updated port of “WP-REST-API V2 Menus” by Claudio La Barbera (http://www.claudiolabarbera.com)

Usage

Get all registered menus:

GET /wp-menus/v1/menus
https://yourwpsite.com/wp-json/wp-menus/v1/menus

Get menu data as JSON from menu slug:

GET /wp-menus/v1/menus/{slug}
https://yourwpsite.com/wp-json/wp-menus/v1/menus/{slug}

Gets the contents of a registered menu by its “slug”.

When assigning a menu a location in /wp-admin/nav-menus.php?action=locations
the slug is the name of the menu in lowercase and without any spaces like a post slug.

If your menu name is Main Menu:
https://yourwpsite.com/wp-json/menus/v1/wp-menus/main-menu

安裝

There are no requirements other than WordPress and one active menu. Installation is simple:

  1. Upload the wp-rest-api-menus folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

常見問題

Installation Instructions

There are no requirements other than WordPress and one active menu. Installation is simple:

  1. Upload the wp-rest-api-menus folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
How do I use this plugin?

It creates a JSON interpretation of any “registered” menu mainly for front-end use. If you have any questions feel free to contact me: https://www.amorphouswebsolutions.com/contact/

評價

There are no reviews for this plugin.

貢獻者及開發者

“WP-REST-API Menus” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 WP-REST-API Menus 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

1.0

  • Requires PHP 5.6x at the very least.