Repository navigation
feat: Add support for Ability Deprecation - #13852
justlevine wants to merge 8 commits into
Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
- Support `true` as a shorthand for the `deprecated` meta filter in `wp_get_abilities()`, so REST API and PHP callers can request only deprecated abilities. - Validate that the deprecation `replacement` detail is a namespaced ability name. - Handle the `deprecated_ability_run` action while serving REST API requests. The notice becomes an `X-WP-DeprecatedAbility` header instead of corrupting the JSON response when `WP_DEBUG` is enabled. - Document the `deprecated` collection parameter details in the REST API schema. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- `meta.deprecated` now takes `null|array` instead of `false|array` - `wp_get_abilities()` hide deprecated abilities by default, a new `allow_deprecated` (or explicit meta filtering) includes them.
e706554 to
575c8f0
Compare
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Trac ticket: https://core.trac.wordpress.org/ticket/64209
Adds a standard way to deprecate an ability without removing it.
Supersedes #10507 (relevant diff)
More specifically:
Adds a
meta.deprecatedproperty (defaultnull). Set it to an array to mark an ability as deprecated:Deprecated abilities are hidden from
wp_get_abilities()by default, but can be included with theincluded_deprecatedarg, or by explicitly filtering fordeprecatedmetadata.Retrieving or executing a deprecated ability will output a deprecation notice. The deprecated ability only outputs one deprecation notice per lifecycle. Deprecation notices on retrieval (only) are suppressed when
include_deprecatedormeta.deprecatedis explicitly filtered by inwp_get_abilities()Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 5.5
Used for: Updating the tests after changing from #10507
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.