function ShortcutTestHooks::blockAlter

Same name and namespace in other branches
  1. 11.x core/modules/shortcut/tests/modules/shortcut_test/src/Hook/ShortcutTestHooks.php \Drupal\shortcut_test\Hook\ShortcutTestHooks::blockAlter()

Implements hook_block_alter().

Attributes

#[Hook('block_alter')]

See also

\Drupal\Tests\shortcut\Functional\testNavigationSafeBlockDefinition()

File

core/modules/shortcut/tests/modules/shortcut_test/src/Hook/ShortcutTestHooks.php, line 31

Class

ShortcutTestHooks
Hooks implementations for shortcut_test module.

Namespace

Drupal\shortcut_test\Hook

Code

public function blockAlter(&$definitions) : void {
  if ($this->state
    ->get('navigation_safe_alter')) {
    $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.