Opened 2 months ago
Last modified 6 days ago
#64657 new enhancement
Add `core/get-user` ability
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | normal | Version: | trunk |
| Component: | Abilities API | Keywords: | abilities has-patch |
| Focuses: | Cc: |
Description
Introduce a new Abilities API ability, core/get-user, to retrieve profile data for a specific user by id, username, or email.
Core currently has core/get-user-info for the current authenticated user only (and not exposed in REST). Agent/workflows use cases need to be able to look up any user when permissions allow it.
Proposed behavior
- Register
core/get-userin theuserability category. - Input schema:
- Require one of:
id(integer),username(string), oremail(string). - Optional:
include_capabilities(boolean, defaultfalse).
- Require one of:
- Output schema includes:
id,username,email,display_name,first_name,last_name,nickname,description,url,link,slug,registered_date,roles,locale,avatar_urls.- Optional
capabilitieswheninclude_capabilitiesis true.
- Permission model:
- User must be logged in.
- Users can view their own record.
- Viewing other users requires
list_users.
- Expose the ability in REST (
show_in_resttrue). - Return
user_not_founderror when no matching user exists.
Notes / follow-ups
- This ticket scopes the initial profile payload.
- Follow-up can extend response data (for example, registered user meta with schema).
References
Change History (6)
This ticket was mentioned in PR #11434 on WordPress/wordpress-develop by @iamadisingh.
3 weeks ago
#2
- Keywords has-patch added
This ticket was mentioned in Slack in #core-ai by aditya_singh. View the logs.
3 weeks ago
This ticket was mentioned in PR #11525 on WordPress/wordpress-develop by @sangu3105.
2 weeks ago
#4
Ticket: 64657
Link: https://core.trac.wordpress.org/ticket/64657
Registered a new Ability of Get User info and Show_in_rest is true.
Adds a new
core/get-userability to the Abilities API that retrieves profile data for a specific user byid,username, oremail. User must be logged in. Users can view their own record. Viewing other users requireslist_users.Trac ticket: https://core.trac.wordpress.org/ticket/64657
## Use of AI Tools