[WordPress] 外掛分享: WP REST API – User Meta

首頁外掛目錄 › WP REST API – User Meta
WordPress 外掛 WP REST API – User Meta 的封面圖片
40+
安裝啟用
★★★★
4/5 分(4 則評價)
360 天前
最後更新
問題解決
WordPress 4.4+ v1.0.0 上架:2017-04-08

內容簡介

現在您無需進行其他請求以從預設的 JSON 回應中獲取作者信息(姓名、顯示名稱、名字、姓氏、電子郵件、使用者註冊日期),因為這些信息都在‘author_meta’字段中提供。

例如,在‘wp-json/wp/v2/posts’ 中,您可以找到只包含id的預設字段‘author’。使用此外掛程式,您還可以找到新的‘author_meta’字段,其中包括作者的詳細信息。

之前:
{

author: 1

}

之後:
{

author_meta: {
ID:”1″,
display_name:”admin”,
user_email:”[email protected]”,
user_nicename:”admin”,
user_registered:”2016-03-01 21:25:23″
}

}

致謝

此外掛程式由Ruhul Amin創建

外掛標籤

開發者團隊

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

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

原文外掛簡介

Now you have no need to make additional requests to get author info from their id that is available in the default json response.
This plugin allows you to configure which user meta fields should be included in the REST API response through an easy-to-use admin interface.
Features

Configurable user meta fields
Includes avatar URL option
Shows user role information
No additional API requests needed
Clean implementation

Available Fields

Nickname
Description
User URL
First Name
Last Name
User Email
Role
Avatar

Example Response:
{
“id”: 1,
“title”: “Sample Post”,
“author”: 1,
“author_meta”: {
“first_name”: “John”,
“last_name”: “Doe”,
“role”: “administrator”,
“avatar”: “https://secure.gravatar.com/…”
}
}
Credits
This plugin is created by Ruhul Amin
Support
For support, please visit http://www.ruhulamin.me/

延伸相關外掛

文章
Filter
Apply Filters
Mastodon