Repository navigation
Set the public meta flag on the core abilities - #1122
Conversation
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.
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
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
… 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>
… 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>
What?
Sets the
publicmeta flag oncore/content-query,core/settings-get, andcore/users-query. Their deprecated aliases copy the meta, socore/read-content,core/read-settings, andcore/read-usersare public too.Why?
WordPress 7.1 added a
publicmeta 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 tofalse, so on 7.1 the plugin's core abilities reportpublic: false, andwp_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.publicwhenpublicis 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' => truenext to'show_in_rest' => true.show_in_reststays because WordPress 7.0 ignorespublic, and the plugin still supports 7.0. The registration tests check the new flag.Testing Instructions
develop, the list has core's owncore/get-site-info,core/get-user-info, andcore/get-environment-infobut none of the plugin's abilities. On this branch, it also hascore/content-query,core/settings-get,core/users-query, and their deprecated aliases.Changelog Entry