diff --git a/src/wp-includes/class-wp-entity-actions-registry.php b/src/wp-includes/class-wp-entity-actions-registry.php index ba523d3a6c760..1ee5e722cf818 100644 --- a/src/wp-includes/class-wp-entity-actions-registry.php +++ b/src/wp-includes/class-wp-entity-actions-registry.php @@ -48,7 +48,7 @@ class WP_Entity_Actions_Registry { * @var array */ const SUPPORTED_VALUES = array( - 'context' => array( 'list', 'single' ), + 'context' => array( 'list' ), 'modalSize' => array( 'small', 'medium', 'large', 'fill' ), ); @@ -230,8 +230,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.' );