You are here

function layout_builder_plugin_filter_block_alter in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/layout_builder.module \layout_builder_plugin_filter_block_alter()

Implements hook_plugin_filter_TYPE_alter().

File

core/modules/layout_builder/layout_builder.module, line 244
Provides hook implementations for Layout Builder.

Code

function layout_builder_plugin_filter_block_alter(array &$definitions, array $extra, $consumer) {

  // @todo Determine the 'inline_block' blocks should be allowed outside
  //   of layout_builder https://www.drupal.org/node/2979142.
  if ($consumer !== 'layout_builder' || !isset($extra['list']) || $extra['list'] !== 'inline_blocks') {
    foreach ($definitions as $id => $definition) {
      if ($definition['id'] === 'inline_block') {
        unset($definitions[$id]);
      }
    }
  }
}