function hook_plugin_filter_TYPE__CONSUMER_alter
Same name in other branches
- 9 core/lib/Drupal/Core/Plugin/plugin.api.php \hook_plugin_filter_TYPE__CONSUMER_alter()
- 10 core/lib/Drupal/Core/Plugin/plugin.api.php \hook_plugin_filter_TYPE__CONSUMER_alter()
- 11.x 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().
File
-
core/
lib/ Drupal/ Core/ Plugin/ plugin.api.php, line 61
Code
function hook_plugin_filter_TYPE__CONSUMER_alter(array &$definitions, array $extra) {
// Explicitly remove the "Help" block for this consumer.
unset($definitions['help_block']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.