function FilteredPluginManagerInterface::getFilteredDefinitions

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Plugin/FilteredPluginManagerInterface.php \Drupal\Core\Plugin\FilteredPluginManagerInterface::getFilteredDefinitions()
  2. 10 core/lib/Drupal/Core/Plugin/FilteredPluginManagerInterface.php \Drupal\Core\Plugin\FilteredPluginManagerInterface::getFilteredDefinitions()
  3. 11.x core/lib/Drupal/Core/Plugin/FilteredPluginManagerInterface.php \Drupal\Core\Plugin\FilteredPluginManagerInterface::getFilteredDefinitions()

Gets the plugin definitions for a given type and consumer and filters them.

This allows modules and themes to alter plugin definitions at runtime, which is useful for tasks like hiding specific plugins from a particular user interface.

Parameters

string $consumer: A string identifying the consumer of these plugin definitions.

\Drupal\Component\Plugin\Context\ContextInterface[]|null $contexts: (optional) Either an array of contexts to use for filtering, or NULL to not filter by contexts.

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

Return value

\Drupal\Component\Plugin\Definition\PluginDefinitionInterface[]|array[] An array of plugin definitions that are filtered.

See also

hook_plugin_filter_TYPE_alter()

hook_plugin_filter_TYPE__CONSUMER_alter()

File

core/lib/Drupal/Core/Plugin/FilteredPluginManagerInterface.php, line 34

Class

FilteredPluginManagerInterface
Provides an interface for plugin managers that allow filtering definitions.

Namespace

Drupal\Core\Plugin

Code

public function getFilteredDefinitions($consumer, $contexts = NULL, array $extra = []);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.