function NavigationTestHooks::blockAlter
Same name and namespace in other branches
- 11.x core/modules/navigation/tests/navigation_test/src/Hook/NavigationTestHooks.php \Drupal\navigation_test\Hook\NavigationTestHooks::blockAlter()
Implements hook_block_alter().
Attributes
#[Hook('block_alter')]
File
-
core/
modules/ navigation/ tests/ navigation_test/ src/ Hook/ NavigationTestHooks.php, line 30
Class
- NavigationTestHooks
- Hooks implementations for navigation_test module.
Namespace
Drupal\navigation_test\HookCode
public function blockAlter(&$definitions) : void {
if ($this->state
->get('navigation_safe_alter')) {
$definitions['navigation_link']['allow_in_navigation'] = TRUE;
$definitions['navigation_shortcuts']['allow_in_navigation'] = FALSE;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.