Opened 111 minutes ago
Last modified 110 minutes ago
#66268 new feature request
Add `core/content-query` ability
| Reported by: | jorgefilipecosta | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Abilities API | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description
Introduces a new Abilities API ability, core/content-query, to retrieve and query post (including custom post types with ability support).
Core currently has core/get-user-info for the current authenticated user only. Agent/workflows use cases need to be able to look up any user when permissions allow it.
It should introduce a show_in_abilities option on register_post_type() to control which post types expose abilities, enabled by default at least for post and page initially.
It should support single-post retrieval by ID and multi-post querying with filters for status, author, etc...
Change History (1)
This ticket was mentioned in PR #12195 on WordPress/wordpress-develop by @jorgefilipecosta.
110 minutes ago
#1
- Keywords has-unit-tests added
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Part of https://github.com/WordPress/ai/issues/40. Ports the
core/content-queryability from the AI plugin, added in https://github.com/WordPress/ai/pull/739, renamed fromcore/read-contentin https://github.com/WordPress/ai/pull/1002, and updated with the read changes from https://github.com/WordPress/ai/pull/1025.core/content-queryability, in a newcontentcategory, through the internalWP_Content_Abilitiesclass.show_in_abilitiespost type argument that controls which post types the ability can read. It defaults tofalse;postandpageset it totrue.id, or bypost_typeandslug, or a page of posts of one type filtered bystatus,author_slug,parent, orinclude, withfieldsto choose what each post returns.publishneed edit access, orread_private_postsforprivate.Testing Instructions
Verify unit tests are passing:
Trac ticket: https://core.trac.wordpress.org/ticket/66268
Use of AI Tools
AI assistance: Yes. Claude Code was used to sync this PR with the plugin and apply the review feedback; I reviewed the changes.