Skip to content

Editor: Remove the unsupported single action context - #14545

Closed
jorgefilipecosta wants to merge 2 commits into
WordPress:trunkfrom
jorgefilipecosta:remove/entity-actions-single-context
Closed

jorgefilipecosta wants to merge 2 commits into
WordPress:trunkfrom
jorgefilipecosta:remove/entity-actions-single-context

Conversation

@jorgefilipecosta

@jorgefilipecosta jorgefilipecosta commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Backports WordPress/gutenberg#85186.

Removes single from the context values the entity actions registry supports, leaving list.

single came from the DataViews Action type, which describes context as "only a meta information for now". No screen shows the actions of that context: the editor's post actions menu calls usePostActions() without a context, so it keeps only the actions without one, and the lists keep list. A plugin could register an action with context => '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:

  • Sets WP_Entity_Actions_Registry::SUPPORTED_VALUES['context'] to array( 'list' ), so single is reported with _doing_it_wrong(), like any other unsupported value, and is no longer in the /wp/v2/entity-actions schema enum.
  • Uses single as the unsupported context in the invalid values test.

Testing Instructions

  1. Register an action with 'context' => 'single' on wp_entity_actions_api_init and verify a _doing_it_wrong() notice names it ("context is not one of list.").
  2. Verify the context property of OPTIONS /wp/v2/entity-actions only lists list.
  3. Run 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.

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.
@github-actions

Copy link
Copy Markdown

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props jorgefilipecosta.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

DataViews no longer lists `single` for the context of an action.

See #66343.
wporg-sync pushed a commit that referenced this pull request Oct 20, 2026
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
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Oct 20, 2026
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
@jorgefilipecosta

Copy link
Copy Markdown
Member Author

Committed at 9ec9604.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants