Same name and namespace in other branches
  1. 10 core/core.api.php \hook_layout_alter()
  2. 9 core/core.api.php \hook_layout_alter()

Allow modules to alter layout plugin definitions.

Parameters

\Drupal\Core\Layout\LayoutDefinition[] $definitions: The array of layout definitions, keyed by plugin ID.

Related topics

2 functions implement hook_layout_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

field_layout_test_layout_alter in core/modules/field_layout/tests/modules/field_layout_test/field_layout_test.module
Implements hook_layout_alter().
layout_builder_plugin_filter_layout_alter in core/modules/layout_builder/layout_builder.module
Implements hook_plugin_filter_TYPE_alter().

File

core/core.api.php, line 2158
Documentation landing page and topics, plus core library hooks.

Code

function hook_layout_alter(&$definitions) {

  // Remove a layout.
  unset($definitions['twocol']);
}