function hook_layout_builder_restrictions_allowed_layouts_alter in Layout Builder Restrictions 8
Alter the keys allowed.
Parameters
array $keys: The keys currently allowed.
2 invocations of hook_layout_builder_restrictions_allowed_layouts_alter()
- LayoutBuilderRestrictionsSubscriber::alterLayoutChooser in src/
EventSubscriber/ LayoutBuilderRestrictionsSubscriber.php - Alters the layouts available in Layout Builder's choose_section.
- layout_builder_restrictions_plugin_filter_layout__layout_builder_alter in ./
layout_builder_restrictions.module - Implements hook_plugin_filter_TYPE__CONSUMER_alter().
File
- ./
layout_builder_restrictions.api.php, line 64 - Api.php for layout_builder_restrictions.
Code
function hook_layout_builder_restrictions_allowed_layouts_alter(array &$keys) {
// Unset some keys that another module has allowed.
foreach ($keys as $delta => $key) {
if ($key == 'layout_onecol') {
unset($keys[$delta]);
}
}
}