[WordPress] 外掛分享: SearchWP API

首頁外掛目錄 › SearchWP API
WordPress 外掛 SearchWP API 的封面圖片
100+
安裝啟用
★★★★★
5/5 分(4 則評價)
3723 天前
最後更新
問題解決
WordPress 4.3.1+ v1.1.0 上架:2015-07-05

內容簡介

此外掛可透過 WordPress REST API 和 SearchWP 執行進階搜尋。

為 WordPress REST API 新增了一個端點,以透過 SearchWP 進行搜尋 - SearchWP 是改善 WordPress 搜尋功效及效能最佳工具。

此外掛由 CalderaWP 免費提供,非 SearchWP 的官方附加元件。

需要 WordPress REST API (WP-API) 2.0-beta9 或更新版本,或 WordPress 4.4 或更新版本。
需要 SearchWP 版本 2.6 或更新版本

理論上沒有 SearchWP 也可以運作,但查詢會透過 WP_Query。

查詢範例

欲瞭解可能的全部查詢清單,請參閱:https://calderawp.com/doc/searchwp-api-queries/
* wp-json/swp_api/search?s=jedi&egnine=star-wars
* wp-json/swp_api/search?&tax_query[field]=slug&tax_query[taxonomy]=categories&tax_query[terms]=1
* wp-json/swp_api/search?meta_query[key]=jedi&meta_query[value]=luke&tax_query[compare]=IN

此外掛是否可與 REST API 的版本 1 搭配使用?

不行。

安裝後什麼也沒發生?

您可能在使用版本 1 的 REST API 或 SearchWP 尚未更新到 2.6 以上。

此外掛的精美程度?

非常美觀。

版本 1.1.0 – 2015年1月

複雜的元查詢
如果無法使用 SearchWP,則回退至 WP_Query

版本 1.0.0 – 2015年7月6日

最初版本

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「SearchWP API」→ 直接安裝(推薦)

原文外掛簡介

Run advanced searches via the WordPress REST API and SearchWP.
Adds an endpoint to the WordPress REST API for searching via SearchWP — the best tool for improving the usefulness and performance of WordPress search.
This plugin is a free plugin by CalderaWP. It is not an official add-on for SearchWP.

Requires WordPress REST API (WP-API) 2.0-beta9 or later or WordPress 4.4 or later.
Requires SearchWP Version 2.6 or later

Technically will work without SearchWP, but queries will run through WP_Query.
Example Queries
For a complete list of possible queries, see: https://calderawp.com/doc/searchwp-api-queries/
* wp-json/swp_api/search?s=jedi&egnine=star-wars
* wp-json/swp_api/search?&tax_query[field]=slug&tax_query[taxonomy]=categories&tax_query[terms]=1
* wp-json/swp_api/search?meta_query[key]=jedi&meta_query[value]=luke&tax_query[compare]=IN
Does It Work With Version 1 of The REST API?
No, it does not.
I Installed It And Nothing Happened
You are probably using version 1 of the REST API, or have not updated SearchWP past 2.6.
How Shiny Is This Plugin?
Very shiny.
Version 1.1.0 – January, 2015

Complex meta queries
Fallback to WP_Query if not possible to use SearchWP

Version 1.0.0 – July 6, 2015
Initial release

延伸相關外掛

文章
Filter
Apply Filters
Mastodon