
內容簡介
現在您無需進行其他請求以從預設的 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創建
外掛標籤
開發者團隊
原文外掛簡介
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/
