前言介紹
- 這款 WordPress 外掛「WP REST API – Pure Taxonomies」是 2016-02-11 上架。
- 目前有 600 個安裝啟用數。
- 上一次更新是 2016-03-01,距離現在已有 3350 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 4.4 以上版本才可以安裝。
- 有 5 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
magikru |
外掛標籤
api | wp-api | rest-api | categories | taxonomies |
內容簡介
現在您不需要額外的請求來獲取分類信息(term_id、name、slug、term_group、term_taxonomy_id、taxonomy、description、parent、count、filter),其ID已經在默認的JSON響應中可用。
現在所有可用的分類法的信息都在您的JSON響應的‘pure_taxonomies’字段中。它適用於所有自定義添加的分類法和自定義文章類型。
例如,在‘wp-json/wp/v2/posts’中,您可以找到默認的‘categories’和‘tags’字段以及包含其ID的自定義添加分類法的名稱。使用此外掛,您也可以找到新的‘pure_taxonomies’字段,其中包含所有可用的‘categories’、‘tags’和自定義分類法數據。
之前:
{
…
categories: [
3
],
tags: [
2
],
custom_taxonomy_name: [
1
]
…
}
之後:
{
…
pure_taxonomies: {
categories: [
{
term_id: 3,
name: “First category”,
slug: “first-category”,
term_group: 0,
term_taxonomy_id: 3,
taxonomy: “category”,
description: “”,
parent: 0,
count: 3,
filter: “raw”,
cat_ID: 3,
category_count: 3,
category_description: “”,
cat_name: “First category”,
category_nicename: “first-category”,
category_parent: 0
}
],
tags: [
{
term_id: 2,
name: “First tag”,
slug: “first-tag”,
term_group: 0,
term_taxonomy_id: 2,
taxonomy: “post_tag”,
description: “”,
parent: 0,
count: 2,
filter: “raw”
}
],
custom_taxonomy_name: [
{
term_id: 1,
name: “Custom Taxonomy Name”,
slug: “custom-taxonomy-name”,
term_group: 0,
term_taxonomy_id: 1,
taxonomy: “custom_taxonomy_name”,
description: “”,
parent: 0,
count: 1,
filter: “raw”
}
]
}
…
}
透過這個連結可以查看我製作的有用的 rest-api 外掛:https://wordpress.org/plugins/tags/andrew-magik-rest-api.
原文外掛簡介
Now you have no need to make additional requests to get taxonomy info (term_id, name, slug, term_group, term_taxonomy_id, taxonomy, description, parent, count, filter) from their id that is available in the default json response.
Now all available taxonomy data is available in ‘pure_taxonomies’ field from your json response. It works for all custom added taxonomies, and for custom post types.
For example in ‘wp-json/wp/v2/posts’ you can find default fields ‘categories’, ‘tags’ and name of custom added taxonomies that contain only its id. With this plugin you can also find new ‘pure_taxonomies’ field that include all available ‘categories’, ‘tags’ and custom taxonomies data.
Before:
{
…
categories: [
3
],
tags: [
2
],
custom_taxonomy_name: [
1
]
…
}
After:
{
…
pure_taxonomies: {
categories: [
{
term_id: 3,
name: “First category”,
slug: “first-category”,
term_group: 0,
term_taxonomy_id: 3,
taxonomy: “category”,
description: “”,
parent: 0,
count: 3,
filter: “raw”,
cat_ID: 3,
category_count: 3,
category_description: “”,
cat_name: “First category”,
category_nicename: “first-category”,
category_parent: 0
}
],
tags: [
{
term_id: 2,
name: “First tag”,
slug: “first-tag”,
term_group: 0,
term_taxonomy_id: 2,
taxonomy: “post_tag”,
description: “”,
parent: 0,
count: 2,
filter: “raw”
}
],
custom_taxonomy_name: [
{
term_id: 1,
name: “Custom Taxonomy Name”,
slug: “custom-taxonomy-name”,
term_group: 0,
term_taxonomy_id: 1,
taxonomy: “custom_taxonomy_name”,
description: “”,
parent: 0,
count: 1,
filter: “raw”
}
]
}
…
}
Check my other useful rest-api plugins: https://wordpress.org/plugins/tags/andrew-magik-rest-api.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「WP REST API – Pure Taxonomies」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
JWT Authentication for WP REST API 》此外掛使用 JSON Web Tokens (JWT) 做為驗證方式,擴充了 WP REST API 。JSON Web Tokens 是一種開放且具有行業標準的方法,用來在兩方之間安全地傳遞聲明。,...。
ACF to REST API 》此 WordPress 外掛在WordPress REST API中提供了Advanced Custom Fields的端點, 詳細資訊請參閱GitHub:https://github.com/airesvsg/acf-to-rest-api/。
REST API Log 》這是一款針對 WordPress REST API v2 的外掛程式,可記錄 REST API 的請求和回應紀錄。, 功能包括:, , WordPress 管理頁面,用於查看和搜尋日誌條目, API 端...。
REST API Meta Support 》此外掛可以自動將 WordPress REST API 的文章(/wp-json/wp/v2/posts)或頁面(/wp-json/wp/v2/pages) POST 中的 meta 欄位所包含的元數據自動存儲於建立的...。
WP API Menus 》此外掛擴充了 WordPress JSON REST API,並提供 WordPress 註冊選單的新路徑。, 現在提供的新路徑如下:, , /menus 所有已註冊選單的清單。, /menus/
Password Reset with Code for WordPress REST API 》這是一個簡單的外掛程式,可以在 WordPress REST API 中使用代碼添加重設密碼功能。 此過程是一個兩步驟的流程:, , 用戶請求重設密碼。一個四位數的代碼將發...。
ACF to WP-API 》此外掛能夠將文章、頁面、自定義文章類型、評論、附件和分類法詞彙中的所有 ACF 欄位,整合進 WP-API 輸出中的「acf」鍵下。此外,此外掛亦會新增一個/option...。
WP REST API Cache 》啟用 WordPress REST API 快取並提升應用程式的速度。, 詳情請參閱 GitHub:http://github.com/airesvsg/wp-rest-api-cache。
WP API Yoast SEO 》在一般的文章或頁面請求中返回 Yoast 文章或頁面的元數據。將元數據儲存在回傳資料的 yoast_meta 欄位中。。
SearchWP API 》此外掛可透過 WordPress REST API 和 SearchWP 執行進階搜尋。, 為 WordPress REST API 新增了一個端點,以透過 SearchWP 進行搜尋 - SearchWP 是改善 WordPr...。
WP Custom REST API Generator 》WP Custom REST API Generator 外掛提供一個介面在 WordPress 的管理面板中,允許使用者控制所有可用的文章類型的作者資訊、特色圖片、自訂欄位和分類法是否...。
REST API Multiple Post Types 》若 WordPress 外掛中的文章類型使用 WordPress REST API(在聲明文章類型時,show_in_rest 必須設為 true),則可以使用 /wp/v2/posts 進行查詢。, 查詢範例,...。
User Data Fields For JWT Authentication 》,原文描述並未完成,缺少後續內容。。
WP REST API – All Terms 》這個外掛將會新增一個單獨的 WordPress REST API(v2)端點,其中包含所有可用的術語(所有已使用的類別、標籤和自訂分類法)。, 當您需要在應用程式中建立一...。
WP-REST-API Menus 》此外掛新增了「路徑」或「終點」至 WP REST API,以 JSON 格式檢索選單資料。, 此為 Claudio La Barbera (http://www.claudiolabarbera.com) 的 WP-REST-API ...。