From 39612a7dde734cd67797250dfbbe7137d5d69dc0 Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Tue, 20 Oct 2026 12:32:24 +0100 Subject: [PATCH 1/2] Editor: Remove the unsupported `single` action context. 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. --- src/wp-includes/class-wp-entity-actions-registry.php | 9 ++++++--- tests/phpunit/tests/entity-actions.php | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/class-wp-entity-actions-registry.php b/src/wp-includes/class-wp-entity-actions-registry.php index ba523d3a6c760..1e285df276931 100644 --- a/src/wp-includes/class-wp-entity-actions-registry.php +++ b/src/wp-includes/class-wp-entity-actions-registry.php @@ -43,12 +43,15 @@ class WP_Entity_Actions_Registry { * The values DataViews supports for the properties of an action that * take one of a set of values, see packages/dataviews/src/types/dataviews.ts. * + * The DataViews types also list `single` for `context`, but no screen + * shows the actions of that context, so it is not supported here. + * * @since 7.2.0 * * @var array */ const SUPPORTED_VALUES = array( - 'context' => array( 'list', 'single' ), + 'context' => array( 'list' ), 'modalSize' => array( 'small', 'medium', 'large', 'fill' ), ); @@ -230,8 +233,8 @@ public function register( $origin, $kind, $name, $actions, $script_module = null * _doing_it_wrong(). * * A value DataViews does not support is otherwise silent: an action - * whose `context` is not `list` or `single` shows on no screen. Such a - * value is kept, like the field types the fields registry reports. + * whose `context` is not `list` shows on no screen. Such a value is + * kept, like the field types the fields registry reports. * `callback`, `RenderModal`, and `isEligible` are functions and * components, which only a script module can provide: a value set on * the server would be called on the client and fail, so it is removed. diff --git a/tests/phpunit/tests/entity-actions.php b/tests/phpunit/tests/entity-actions.php index 5643906778bc2..2928351e5df10 100644 --- a/tests/phpunit/tests/entity-actions.php +++ b/tests/phpunit/tests/entity-actions.php @@ -741,7 +741,7 @@ public function test_registering_an_action_with_invalid_values_is_reported() { array( 'id' => 'archive', 'label' => 'Archive', - 'context' => 'lists', + 'context' => 'single', 'isEligible' => true, ), array( @@ -754,12 +754,12 @@ public function test_registering_an_action_with_invalid_values_is_reported() { $this->assertSame( array( 'feature', 'archive', 'export' ), $registered, 'The actions are registered anyway.' ); $actions = array_column( wp_get_registered_entity_actions( 'postType', 'page' ), null, 'id' ); - $this->assertSame( 'lists', $actions['archive']['context'], 'A value DataViews does not support is kept.' ); + $this->assertSame( 'single', $actions['archive']['context'], 'A value DataViews does not support is kept.' ); $this->assertSame( 'huge', $actions['export']['modalSize'], 'A value DataViews does not support is kept.' ); $this->assertArrayNotHasKey( 'isEligible', $actions['archive'], 'A property only a script module can provide is removed.' ); $this->assertCount( 1, $reported ); $this->assertStringContainsString( 'postType "page"', $reported[0], 'The notice names the entity.' ); - $this->assertStringContainsString( ': archive (context is not one of list and single.)', $reported[0], 'The notice names the action and its value DataViews does not support.' ); + $this->assertStringContainsString( ': archive (context is not one of list.)', $reported[0], 'The notice names the action and its value DataViews does not support.' ); $this->assertStringContainsString( 'archive (isEligible can only come from a script module', $reported[0], 'The notice names the property that is removed.' ); $this->assertStringContainsString( 'export (modalSize is not one of small, medium, large, and fill.)', $reported[0], 'The notice names every value DataViews does not support.' ); $this->assertStringNotContainsString( 'feature', $reported[0], 'The other actions of the call are not reported.' ); From 28b9835564089755ba81b404b6d13680985afb43 Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Tue, 20 Oct 2026 13:35:29 +0100 Subject: [PATCH 2/2] Editor: Drop the note on the DataViews `single` context. DataViews no longer lists `single` for the context of an action. See #66343. --- src/wp-includes/class-wp-entity-actions-registry.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/wp-includes/class-wp-entity-actions-registry.php b/src/wp-includes/class-wp-entity-actions-registry.php index 1e285df276931..1ee5e722cf818 100644 --- a/src/wp-includes/class-wp-entity-actions-registry.php +++ b/src/wp-includes/class-wp-entity-actions-registry.php @@ -43,9 +43,6 @@ class WP_Entity_Actions_Registry { * The values DataViews supports for the properties of an action that * take one of a set of values, see packages/dataviews/src/types/dataviews.ts. * - * The DataViews types also list `single` for `context`, but no screen - * shows the actions of that context, so it is not supported here. - * * @since 7.2.0 * * @var array