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
Adopt the high-level `public` flag introduced in [62729] for the core abilities that ship with WordPress. The `core/get-site-info`, `core/get-user-info`, and `core/get-environment-info` abilities now declare `meta.public` instead of `meta.show_in_rest`.
The `public` flag seeds `show_in_rest` through the resolution chain, so REST exposure stays exactly the same. Storing the intent as `public` also lets other channels such as MCP and AI agents read it through the `wp_register_ability_args` filter. An explicit `show_in_rest` still wins when a channel needs to opt out.
Also make the `public` flag default to `false` so it is always present in the resolved meta, treat a `null` value as unset, and reword the related documentation across the ability class, the registry, the REST schema, and `wp_register_ability()`.
Follow-up to [62729].
Props gziolo, mukesh27, khokansardar.
Fixes #65568.
git-svn-id: https://develop.svn.wordpress.org/trunk@62737 602fd350-edb4-49c9-b593-d223f7449a82
Copy file name to clipboardExpand all lines: src/wp-includes/rest-api/endpoints/class-wp-rest-abilities-v1-list-controller.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -313,7 +313,7 @@ public function get_item_schema(): array {
313
313
'additionalProperties' => true,
314
314
),
315
315
'public' => array(
316
-
'description' => __( 'Whether the ability author intends the ability to be publicly available to clients. Only present when set by the ability author.' ),
316
+
'description' => __( 'Whether the ability is meant to be available to clients such as the REST API, MCP, or AI agents. Defaults to false, but individual channel settings such as show_in_rest can override it.' ),
0 commit comments