Repository navigation
Editor: Remove the unsupported single action context - #14545
jorgefilipecosta wants to merge 2 commits into
Conversation
No screen shows the actions with `context: 'single'`, so the entity actions registry now reports that value like any other unsupported one, and the REST schema no longer lists it. See #66343.
|
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. |
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. |
DataViews no longer lists `single` for the context of an action. See #66343.
Removes `single` from the `context` values the entity actions registry supports, leaving `list`. No screen shows the actions of the `single` context, so an action registered with it showed nowhere. Removing it before 7.2 ships keeps the option to add it later with a defined meaning. An action registered with `single` is now reported with `_doing_it_wrong()`, like any other unsupported value, and `single` is no longer in the `context` enum of the `/wp/v2/entity-actions` schema. Developed in #14545. Synced from WordPress/gutenberg#85186. Follow-up to [64517]. Props jorgefilipecosta, oandregal. See #66343. git-svn-id: https://develop.svn.wordpress.org/trunk@64601 602fd350-edb4-49c9-b593-d223f7449a82
Removes `single` from the `context` values the entity actions registry supports, leaving `list`. No screen shows the actions of the `single` context, so an action registered with it showed nowhere. Removing it before 7.2 ships keeps the option to add it later with a defined meaning. An action registered with `single` is now reported with `_doing_it_wrong()`, like any other unsupported value, and `single` is no longer in the `context` enum of the `/wp/v2/entity-actions` schema. Developed in WordPress/wordpress-develop#14545. Synced from WordPress/gutenberg#85186. Follow-up to [64517]. Props jorgefilipecosta, oandregal. See #66343. Built from https://develop.svn.wordpress.org/trunk@64601 git-svn-id: http://core.svn.wordpress.org/trunk@63751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
Committed at 9ec9604. |
Backports WordPress/gutenberg#85186.
Removes
singlefrom thecontextvalues the entity actions registry supports, leavinglist.singlecame from the DataViewsActiontype, which describescontextas "only a meta information for now". No screen shows the actions of that context: the editor's post actions menu callsusePostActions()without a context, so it keeps only the actions without one, and the lists keeplist. A plugin could register an action withcontext => 'single'and get no notice, but the action would show nowhere. Removing it before 7.2 ships keeps the option to add it later with a defined meaning, rather than having to support it forever. The Gutenberg PR also removes it from the DataViews type.This PR:
WP_Entity_Actions_Registry::SUPPORTED_VALUES['context']toarray( 'list' ), sosingleis reported with_doing_it_wrong(), like any other unsupported value, and is no longer in the/wp/v2/entity-actionsschemaenum.singleas the unsupported context in the invalid values test.Testing Instructions
'context' => 'single'onwp_entity_actions_api_initand verify a_doing_it_wrong()notice names it ("context is not one of list.").contextproperty ofOPTIONS /wp/v2/entity-actionsonly listslist.npm run test:php -- --group entity-actions.Trac ticket: https://core.trac.wordpress.org/ticket/66343
Use of AI Tools
AI assistance: Yes
Used for: writing the code and the tests, and drafting this description; reviewed and edited by me.
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.