admin管理员组文章数量:1417426
I'd like to call WP REST API to update a user. I have only username, so I suppose I should retrieve user ID first of all, as the endpoint for updating a user is:
GET /wp/v2/users/<id>
How to retrieve the ID with username (that is unique as well)?
I tried:
GET /wp/v2/users/?username=USERNAME
but it's not working.
I also tried:
GET /wp/v2/users/?slug=USERNAME
and it works, but I'm not sure it would not return duplicates.
The best would be update directly the user with a single call, with the username as key, but if this is not possible, I would like to be sure 100% the retrieved ID is the one of the unique username I provided.
本文标签: How to update a user with REST API v2 knowing only the username
版权声明:本文标题:How to update a user with REST API v2 knowing only the username? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745262962a2650438.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论