function hook_layout_builder_restrictions_allowed_block_keys_alter in Layout Builder Restrictions 8
Alter the allowed keys.
Parameters
array $keys: The keys that modules have specified.
2 invocations of hook_layout_builder_restrictions_allowed_block_keys_alter()
- LayoutBuilderRestrictionsSubscriber::alterBlockChooser in src/
EventSubscriber/ LayoutBuilderRestrictionsSubscriber.php - Alters the block providers available in Layout Builder's choose_block.
- layout_builder_restrictions_plugin_filter_block__layout_builder_alter in ./
layout_builder_restrictions.module - Implements hook_plugin_filter_TYPE__CONSUMER_alter().
File
- ./
layout_builder_restrictions.api.php, line 32 - Api.php for layout_builder_restrictions.
Code
function hook_layout_builder_restrictions_allowed_block_keys_alter(array &$keys) {
// Unset some keys that another module has allowed.
foreach ($keys as $delta => $key) {
if ($key == (string) t('Custom')) {
unset($keys[$delta]);
}
}
}