function hook_layout_alter

Same name and namespace in other branches
  1. 11.x core/core.api.php \hook_layout_alter()
  2. 10 core/core.api.php \hook_layout_alter()
  3. 9 core/core.api.php \hook_layout_alter()
  4. 8.9.x 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

File

core/core.api.php, line 2345

Code

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

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