function layout_builder_plugin_filter_block_alter

Same name in other branches
  1. 9 core/modules/layout_builder/layout_builder.module \layout_builder_plugin_filter_block_alter()
  2. 10 core/modules/layout_builder/layout_builder.module \layout_builder_plugin_filter_block_alter()
  3. 11.x 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 243

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]);
            }
        }
    }
}

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