Skip to content

Set the public meta flag on the core abilities - #1122

Merged
dkotter merged 1 commit into
developfrom
update/core-abilities-public-meta
Oct 6, 2026
Merged

dkotter merged 1 commit into
developfrom
update/core-abilities-public-meta

Conversation

@jorgefilipecosta

@jorgefilipecosta jorgefilipecosta commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

What?

Sets the public meta flag on core/content-query, core/settings-get, and core/users-query. Their deprecated aliases copy the meta, so core/read-content, core/read-settings, and core/read-users are public too.

Why?

WordPress 7.1 added a public meta flag to the Abilities API (#65568, dev note). It marks an ability as meant for clients such as MCP or AI agents, and core's own abilities set it. The flag defaults to false, so on 7.1 the plugin's core abilities report public: false, and wp_get_abilities( array( 'meta' => array( 'public' => true ) ) ) lists core's abilities but not these.

The MCP adapter reads the flag too. Since 0.6.0, it exposes an ability without its own mcp.public when public is true (WordPress/mcp-adapter#254). With this change, sites running the adapter expose these abilities over MCP, as they already do core's. Their permission checks still apply.

Related: #354.

How?

Each ability adds 'public' => true next to 'show_in_rest' => true. show_in_rest stays because WordPress 7.0 ignores public, and the plugin still supports 7.0. The registration tests check the new flag.

Testing Instructions

  1. On WordPress 7.1, enable the Custom Abilities experiment on the AI settings screen.
  2. List the public abilities:
    wp eval 'foreach ( wp_get_abilities( array( "meta" => array( "public" => true ) ) ) as $ability ) { echo $ability->get_name(), "\n"; }'
    
    On develop, the list has core's own core/get-site-info, core/get-user-info, and core/get-environment-info but none of the plugin's abilities. On this branch, it also has core/content-query, core/settings-get, core/users-query, and their deprecated aliases.
  3. Run the PHP tests:
    npm run test:php -- --filter 'ContentTest|SettingsTest|UsersTest'
    

Changelog Entry

Changed - The core/content-query, core/settings-get, and core/users-query abilities now set the public meta flag added in WordPress 7.1.

Open WordPress Playground Preview

WordPress 7.1 added a public meta flag that marks an ability as meant
for clients such as the REST API, MCP, or AI agents, and core's own
abilities now set it. core/content-query, core/settings-get, and
core/users-query set it too, so 7.1 reports them as public instead of
defaulting the flag to false. The deprecated aliases copy the meta, so
they follow.

show_in_rest stays because WordPress 7.0 ignores public.
@jorgefilipecosta
jorgefilipecosta requested a review from a team October 6, 2026 13:58
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.62%. Comparing base (2cc9603) to head (f16e073).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #1122   +/-   ##
==========================================
  Coverage      81.62%   81.62%           
  Complexity      3088     3088           
==========================================
  Files            129      129           
  Lines          12297    12300    +3     
==========================================
+ Hits           10037    10040    +3     
  Misses          2260     2260           
Flag Coverage Δ
unit 81.62% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@dkotter dkotter added this to the 1.5.0 milestone Oct 6, 2026
@dkotter
dkotter merged commit 0343809 into develop Oct 6, 2026
36 checks passed
@dkotter
dkotter deleted the update/core-abilities-public-meta branch October 6, 2026 14:56
muneeb-ashraf added a commit to muneeb-ashraf/ai that referenced this pull request Oct 7, 2026
Matches the `core/content-query` changes in WordPress#1122 and WordPress#1123: set the
`public` meta flag added in WordPress 7.1, and write multi-line comments
as block comments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6LxjEQnP4PPgXXvAM3M2F
gziolo added a commit to jorgefilipecosta/wordpress-develop that referenced this pull request Oct 7, 2026
… exposure.

Set the `public` meta flag, as the other core abilities do. This
carries over WordPress/ai#1122. In core, `public` also enables
`show_in_rest`.

When `show_in_abilities` is `true`, a setting now uses the same name
and schema as in `show_in_rest`. An array is still used as is. All core
settings use `true`, so they share their names and schemas with the
REST API settings endpoint. For example, `blogname` is exposed as
`title` and `WPLANG` as `language`, and the email and enum schemas are
no longer repeated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jorgefilipecosta pushed a commit to jorgefilipecosta/wordpress-develop that referenced this pull request Oct 8, 2026
… exposure.

Set the `public` meta flag, as the other core abilities do. This
carries over WordPress/ai#1122. In core, `public` also enables
`show_in_rest`.

When `show_in_abilities` is `true`, a setting now uses the same name
and schema as in `show_in_rest`. An array is still used as is. All core
settings use `true`, so they share their names and schemas with the
REST API settings endpoint. For example, `blogname` is exposed as
`title` and `WPLANG` as `language`, and the email and enum schemas are
no longer repeated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants