Make WordPress Core

Opened 2 months ago

Last modified 6 days ago

#64657 new enhancement

Add `core/get-user` ability

Reported by: jorgefilipecosta's profile jorgefilipecosta 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-user in the user ability category.
  • Input schema:
    • Require one of: id (integer), username (string), or email (string).
    • Optional: include_capabilities (boolean, default false).
  • Output schema includes:
    • id, username, email, display_name, first_name, last_name, nickname, description, url, link, slug, registered_date, roles, locale, avatar_urls.
    • Optional capabilities when include_capabilities is 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_rest true).
  • Return user_not_found error 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)

#1 @JeffPaul
5 weeks ago

  • Keywords abilities added

This ticket was mentioned in PR #11434 on WordPress/wordpress-develop by @iamadisingh.


3 weeks ago
#2

  • Keywords has-patch added

Adds a new core/get-user ability to the Abilities API that retrieves profile data for a specific user by id, username, or email. User must be logged in. Users can view their own record. Viewing other users requires list_users.

Trac ticket: https://core.trac.wordpress.org/ticket/64657

## Use of AI Tools

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.

#5 @desrosj
6 days ago

  • Component changed from AI to Abilities API

Moving tickets related to the Abilities API to a new sub-component.

#6 @gziolo
6 days ago

  • Type changed from defect (bug) to enhancement
Note: See TracTickets for help on using tickets.