-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Abilities: Add support for ability deprecation #10507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
|
Hi @JasonTheAdams! 👋 Thank you for your contribution to WordPress! 💖 It looks like this is your first pull request to No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description. Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making. More information about how GitHub pull requests can be used to contribute to WordPress can be found in the Core Handbook. Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook. If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook. The Developer Hub also documents the various coding standards that are followed:
Thank you, |
|
Some topics to discuss:
|
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. |
VersionWhen looking over If it is useful, then we'd need a way for an Ability to note the version, since this function is called automatically within meta.deprecated = false;
meta.deprecated = true;
meta.deprecated = array(
'version' => '1.2.3',
'replacement' => 'foo/v2/my-ability'
); // implied true with further informationI'm kind of partial to the array structure as it only adds a single property to ReplacementThis does feel more valuable, as it would be nice for someone using an Ability to know which Ability is intended to be its successor, if there is one available. As above, we could have a Filtering in
|
|
Hey @JasonTheAdams I touched a bit on your more general comments over on https://core.trac.wordpress.org/ticket/64209#comment:13, but tl;dr I agree with your comparison to ability filtering, and think any deprecation pattern should also be done as a holistic enhancement once the needs are more clearly defined. Which yeah will prob only come after/alongside a basic mechanism for filtering (but IMO no need to tunnel vision that in the rush to ship this) (Syndication is one directional to Trac, replying here to signpost future visitors.) PS: congrats on your "first contribution to WordPress" 🎉🙃🎉 |
This introduces the ability for formally deprecate an Ability, which will be an important system for allowing ability iteration without resulting in multiple discoverable abilities of the same kind. It tackles this on a few fronts:
_deprecated_ability()methodmeta.deprecatedproperty toWP_Ability_deprecated_abilityinWP_Ability::do_execute()if the ability is deprecatedTo do:
wp_get_abilities()wp_get_abilities()Trac ticket: https://core.trac.wordpress.org/ticket/64209