Make WordPress Core

Opened 4 weeks ago

#64657 new defect (bug)

Add `core/get-user` ability

Reported by: jorgefilipecosta's profile jorgefilipecosta Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: trunk
Component: AI Keywords:
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 (0)

Note: See TracTickets for help on using tickets.