[WordPress] 外掛分享: EndPointy Menus

首頁外掛目錄 › EndPointy Menus
WordPress 外掛 EndPointy Menus 的封面圖片
全新外掛
安裝啟用
尚無評分
18 天前
最後更新
問題解決
WordPress 5.0+ v1.2.0 上架:2025-12-15

內容簡介

EndPointy Menus 外掛為 WordPress 提供自訂的 REST API 路由,能將導航選單以 JSON 格式公開,方便開發者在外部應用程式中讀取選單結構。

【主要功能】
• 提供所有註冊選單及其位置和項目
• 根據選單 ID 獲取單一選單及其項目
• 根據選單 slug 獲取單一選單及其項目
• 獲取所有註冊的選單位置
• 支援層級結構的選單項目回傳
• 設定 API 金鑰保護及速率限制

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.2.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「EndPointy Menus」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

EndPointy Menus adds custom REST API routes to expose your WordPress navigation menus as JSON.
Base namespace: endpointy-menus/v1
Endpoints:

GET /wp-json/endpointy-menus/v1/menus
Returns all registered menus with locations and items.

GET /wp-json/endpointy-menus/v1/menus/
Returns a single menu and its items by menu ID.

GET /wp-json/endpointy-menus/v1/menus/slug/
Returns a single menu and its items by menu slug.

GET /wp-json/endpointy-menus/v1/locations
Returns all registered menu locations with assigned menus.

GET /wp-json/endpointy-menus/v1/locations/
Returns a menu assigned to a specific location (e.g., ‘primary’, ‘footer’).

Query Parameters:

nested=true – Returns menu items in a hierarchical tree structure with parent-child relationships.
Example: /wp-json/endpointy-menus/v1/menus/2?nested=true

meta=true – Adds extra item data: description, attr_title, current flag, featured image URL and post excerpt.
Example: /wp-json/endpointy-menus/v1/menus/2?meta=true

fields=id,title,url – Returns only the listed fields per item (children are always kept in nested mode).
Example: /wp-json/endpointy-menus/v1/menus/2?fields=id,title,url

Parameters can be combined, e.g. ?nested=true&meta=true&fields=id,title,url,children.
Settings (Settings → EndPointy Menus):

Response caching with a configurable lifetime (transients, auto-flushed when a menu is edited).
Optional API-key protection via X-API-Key header or api_key query parameter.
CORS allow-list for browser-based consumers.
Per-IP rate limiting (requests/minute) with X-RateLimit headers and 429 responses.
ETag / Last-Modified conditional requests returning 304 Not Modified.

Developer hooks:

endpointy_menus_item filter – modify each formatted menu item before output.

This is useful for headless WordPress setups or any external app that needs to read your menu structure.
Usage
Example requests:
Get all menus:
https://your-site.com/wp-json/endpointy-menus/v1/menus
Get single menu by ID:
https://your-site.com/wp-json/endpointy-menus/v1/menus/2
Get all menu locations:
https://your-site.com/wp-json/endpointy-menus/v1/locations
Get menu by location (e.g., ‘primary’):
https://your-site.com/wp-json/endpointy-menus/v1/locations/primary
Get nested menu structure:
https://your-site.com/wp-json/endpointy-menus/v1/menus/2?nested=true
https://your-site.com/wp-json/endpointy-menus/v1/locations/primary?nested=true
Use these URLs directly from your front-end application or API client.
Support the Developer
If you find this plugin useful, you can support the developer:

Website: https://gunjanjaswal.me
GitHub: https://github.com/gunjanjaswal/Endpointy-Menus
Ko-fi: https://ko-fi.com/gunjanjaswal

Contributing
Contributions, issues, and feature requests are welcome!
GitHub: https://github.com/gunjanjaswal/Endpointy-Menus
Issues: https://github.com/gunjanjaswal/Endpointy-Menus/issues

延伸相關外掛

文章
Filter
Mastodon