[WordPress] 外掛分享: JSONPress

首頁外掛目錄 › JSONPress
10+
安裝啟用
尚無評分
4586 天前
最後更新
問題解決
WordPress 3.5.1+ v0.3 上架:2013-08-26

內容簡介

JSONPress – 讓你透過標準 WordPress 查詢取得 JSON/JSONP 輸出的 WordPress 網站

功能

透過子網域訪問 JSON,例如 api.example.com(子網域必須單獨配置)
支援 JSONP 回調函數。
使用 JSON 漂亮打印 或 print_r 方便調試輸出。
你可以 排除特定欄位/數據 在 JSON 輸出中顯示。
你也可以包括 自定義欄位/數據。
該插件使用 標準 WordPress 查詢,沒有 SQL 黑客等。
使用 標準 WordPress URL,無需記住新的煩人 URL。
還有很多我們在這裡沒有提及的功能。

特別功能

不僅限於文章/頁面,還可以通過 URL 調用一些功能。

範例:

example.com/get/wp_list_categories 顯示以 JSON 格式列出類別列表
example.com/get/wp_list_pages 顯示頁面列表
example.com/get/wp_nav_menu 顯示菜單

嘿,那些功能的 $args 呢?
* example.com/get/wp_list_categories?args[orderby]=ID&args[exclude]=1,3,4&args[child_of]=2 等,非常酷,對吧?
* 建議使用子網域 API,以確保所有鏈接/永久鏈接被重寫為 API URL。

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.3) 或搜尋安裝

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

原文外掛簡介

JSONPress – Allows you to request WordPress site via JSON/JSONP output using standard WordPress query.
Features

Access JSON via sub domain, ex. api.example.com (sub domain must be configured separately)
Supports JSONP callback.
Easy to debug output using JSON pretty print or print_r.
You can exclude columns/data to be displayed in JSON output.
You can include custom fields too.
This plugin uses standard WordPress query, no SQL hack etc.
Use standard WordPress URL, no need to remember new annoying URL.
And many more features I don’t tell here.

Special
Not only posts/page, you can also call some functions via URL.
Examples:

example.com/get/wp_list_categories to displays list categories in JSON format
example.com/get/wp_list_pages to displays list pages
example.com/get/wp_nav_menu to displays menus

Hei, how about $args of those functions?
* example.com/get/wp_list_categories?args[orderby]=ID&args[exclude]=1,3,4&args[child_of]=2 etc. cool, right?
* Use subdomain API is recommended to ensure all links/permalinks are rewritten to API URL.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon