public function LayoutBuilderRestrictionInterface::alterBlockDefinitions in Layout Builder Restrictions 8.2
Alter the block definitions.
This will be called when the block list is being populated for placing a block into a section. A plugin can manipulate the definitions as needed, with optional context about the section being utilized.
Parameters
array $definitions: All the available block definitions.
array $context: At a minimum, the entity, view_mode, layout, and region. Depending on the plugin, they may or may not ignore some of these contexts.
Return value
array A modified block definition array.
1 method overrides LayoutBuilderRestrictionInterface::alterBlockDefinitions()
- LayoutBuilderRestrictionBase::alterBlockDefinitions in src/
Plugin/ LayoutBuilderRestrictionBase.php - Alter the block definitions.
File
- src/
Plugin/ LayoutBuilderRestrictionInterface.php, line 31
Class
- LayoutBuilderRestrictionInterface
- Defines an interface for Layout builder restriction plugin plugins.
Namespace
Drupal\layout_builder_restrictions\PluginCode
public function alterBlockDefinitions(array $definitions, array $context);