2

Actually I am getting all the users list in JSON response but not getting the user role in that listing.

What I have to do for user role?

4

1 回答 1

2

只要您通过身份验证,您只需将?context=edit添加到请求中。

/wp-json/wp/v2/users?context=edit

编辑:这可能仅在您分别查询每个用户时才有效,因为我相信您只能按角色过滤用户列表,而不是列出所有角色。

于 2017-01-20T07:02:16.610 回答