You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a read ability for block templates and whether the active theme supports them #1303
An agent that wants to change how a page looks needs to know first:
whether the active theme is a block theme;
which templates exist, which ones the theme ships as files, and which have been edited.
Today the only way to know is to try. The AI Workspace's template proposals (#1298) check wp_is_block_theme() and get_block_template() themselves at the moment they propose. A read-only ability would let any consumer ask first.
Proposed: core/templates-query returning { block_theme: bool, theme: name, templates: [{ slug, title, source: theme|custom|plugin, has_theme_file }] }, read-only and needing edit_theme_options. Modeled on how the plugin registers core/content-query.
AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for: drafting this issue from the work in the linked PRs, which I checked.
I've reviewed the changes, understand them and can explain them under review.
Hi @whyisjake, thanks for writing this up so clearly, and for splitting the missing abilities out of the AI Workspace work. It made the gap easy to understand.
I'd like to work on this one.
My plan is to follow how core/content-query is registered and add core/templates-query with the shape you proposed:
block_theme from wp_is_block_theme(), plus the active theme's name;
templates from get_block_templates(), each with slug, title, source and has_theme_file;
read-only, gated on edit_theme_options, with tests for block vs. classic themes, theme vs. user-edited templates, and a user without the capability.
A few questions before I start:
Should it cover template parts (wp_template_part) too, or only wp_template for now?
Should it sit behind the Custom Abilities experiment like the other core/* abilities, and be marked public?
Is core/templates-query the name you'd like to keep, or should it match something planned for core?
Happy to adjust to whatever fits best with #1298. I'll open a draft PR once I have something to look at.
I don't feel strongly on how valuable this ability will actually be but the main thing we will need to change here is we should stop using core/ as our prefix.
For reference, that prefix is saved for abilities that we think will end up in WordPress Core itself. Going forward, those abilities will be handled in a separate package instead of directly here (see #1289).
I don't know if this ability warrants a Core version so I'd suggest we go with ai/ as the prefix
Thanks @dkotter, that makes sense. I'll switch the prefix to ai/ in #1309 (as ai/templates-query, unless you'd prefer the ai/get-* style used by ai/get-post-details), and keep it behind the Custom Abilities experiment.
On the value, the concrete case is #1298: the workspace can now propose a block template, but it refuses on a classic theme and refuses to replace a template someone has already edited. Today the model only learns that after it proposes. With this ability it can check first, which theme is active, whether it's a block theme, and which templates are still the theme's own (source: theme) versus edited (source: custom), and propose something that can actually be applied.
It's also useful outside the workspace. Over MCP, an agent asked "what templates does my site have?" can now answer, including which ones were customized in the Site Editor, which it can't find out any other way.
It's read-only, makes no AI calls, and is small. If it doesn't feel worth carrying yet, I'm happy to close it. Just let me know.
Throwing my two cents in: This feels like it should eventually be solvable through core abilities since it concerns reading site data that should share a common structure across all WP sites. Specifically, I think Jake's original description lays out two ability-shaped pieces:
Get metadata about the current theme
Query registered templates
As we move forward with the #1289 proposal, I'd expect those to land as experimental abilities in that package first, with an eye toward developing them for GB or core inclusion later.
Activity
yaman-694 commentedon Nov 6, 2026
Hi @whyisjake, thanks for writing this up so clearly, and for splitting the missing abilities out of the AI Workspace work. It made the gap easy to understand.
I'd like to work on this one.
My plan is to follow how
core/content-queryis registered and addcore/templates-querywith the shape you proposed:block_themefromwp_is_block_theme(), plus the active theme's name;templatesfromget_block_templates(), each withslug,title,sourceandhas_theme_file;edit_theme_options, with tests for block vs. classic themes, theme vs. user-edited templates, and a user without the capability.A few questions before I start:
wp_template_part) too, or onlywp_templatefor now?core/*abilities, and be markedpublic?core/templates-querythe name you'd like to keep, or should it match something planned for core?Happy to adjust to whatever fits best with #1298. I'll open a draft PR once I have something to look at.
dkotter commentedon Nov 6, 2026
I don't feel strongly on how valuable this ability will actually be but the main thing we will need to change here is we should stop using
core/as our prefix.For reference, that prefix is saved for abilities that we think will end up in WordPress Core itself. Going forward, those abilities will be handled in a separate package instead of directly here (see #1289).
I don't know if this ability warrants a Core version so I'd suggest we go with
ai/as the prefixyaman-694 commentedon Nov 8, 2026
Thanks @dkotter, that makes sense. I'll switch the prefix to
ai/in #1309 (asai/templates-query, unless you'd prefer theai/get-*style used byai/get-post-details), and keep it behind the Custom Abilities experiment.On the value, the concrete case is #1298: the workspace can now propose a block template, but it refuses on a classic theme and refuses to replace a template someone has already edited. Today the model only learns that after it proposes. With this ability it can check first, which theme is active, whether it's a block theme, and which templates are still the theme's own (
source: theme) versus edited (source: custom), and propose something that can actually be applied.It's also useful outside the workspace. Over MCP, an agent asked "what templates does my site have?" can now answer, including which ones were customized in the Site Editor, which it can't find out any other way.
It's read-only, makes no AI calls, and is small. If it doesn't feel worth carrying yet, I'm happy to close it. Just let me know.
nikolas4175-godaddy commentedon Nov 10, 2026
Throwing my two cents in: This feels like it should eventually be solvable through core abilities since it concerns reading site data that should share a common structure across all WP sites. Specifically, I think Jake's original description lays out two ability-shaped pieces:
As we move forward with the #1289 proposal, I'd expect those to land as experimental abilities in that package first, with an eye toward developing them for GB or core inclusion later.
jeffpaul commentedon Nov 13, 2026
Flagging to @nikmclaughlin that this will be needed in the abilities package to benefit the AI Workspace effort.