You are here

function hook_plugin_filter_TYPE__CONSUMER_alter in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Plugin/plugin.api.php \hook_plugin_filter_TYPE__CONSUMER_alter()
  2. 9 core/lib/Drupal/Core/Plugin/plugin.api.php \hook_plugin_filter_TYPE__CONSUMER_alter()

Alter the filtering of plugin definitions for a specific type and consumer.

TYPE (e.g. "block", "layout") limits hook scope to a plugin type. CONSUMER (e.g., "block_ui", "layout_builder") limits hook scope to one or more listeners, typically provided the same module. For example, HOOK_plugin_filter_layout__layout_builder_alter() would affect Layout Builder's listeners for the 'layout' plugin type (see ChooseSectionController), while HOOK_plugin_filter_block__block_ui_alter() would affect the Block UI's listeners for the 'block' plugin type.

Parameters

\Drupal\Component\Plugin\Definition\PluginDefinitionInterface[]|array[] $definitions: The array of plugin definitions.

mixed[] $extra: An associative array containing additional information provided by the code requesting the filtered definitions.

Related topics

6 functions implement hook_plugin_filter_TYPE__CONSUMER_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

layout_builder_plugin_filter_block_alter in core/modules/layout_builder/layout_builder.module
Implements hook_plugin_filter_TYPE_alter().
layout_builder_plugin_filter_block__block_ui_alter in core/modules/layout_builder/layout_builder.module
Implements hook_plugin_filter_TYPE__CONSUMER_alter().
layout_builder_plugin_filter_block__layout_builder_alter in core/modules/layout_builder/layout_builder.module
Implements hook_plugin_filter_TYPE__CONSUMER_alter().
layout_builder_plugin_filter_layout_alter in core/modules/layout_builder/layout_builder.module
Implements hook_plugin_filter_TYPE_alter().
layout_builder_plugin_filter_layout__layout_builder_alter in core/modules/layout_builder/layout_builder.module
Implements hook_plugin_filter_TYPE__CONSUMER_alter().

... See full list

File

core/lib/Drupal/Core/Plugin/plugin.api.php, line 61
Hooks provided by the Plugin system.

Code

function hook_plugin_filter_TYPE__CONSUMER_alter(array &$definitions, array $extra) {

  // Explicitly remove the "Help" block for this consumer.
  unset($definitions['help_block']);
}