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
Commit a1d2d15
Browse filesBrowse the repository at this point in the historyBrowse files
Add public meta flag to control exposure defaults for abilities
Introduce a `public` flag in ability metadata as a single high-level control over client exposure. When set, `public` seeds the default for channel-specific flags such as `show_in_rest`: an explicit `show_in_rest` value wins, then `public`, then the built-in default of `false`. This lets an ability opt in to all channels at once, while keeping the ability to opt out of a single channel.
The `public` value is stored in the ability metadata and declared in the REST item schema, so other channels such as MCP and AI agents can read it through the `wp_register_ability_args` filter.
Props iamadisingh, gziolo.
Fixes #65568.
git-svn-id: https://develop.svn.wordpress.org/trunk@62729 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
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -312,6 +312,10 @@ public function get_item_schema(): array {
312
312
),
313
313
'additionalProperties' => true,
314
314
),
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.' ),
0 commit comments