function SystemHooks::blockViewSystemMainBlockAlter

Same name and namespace in other branches
  1. 11.x core/modules/system/src/Hook/SystemHooks.php \Drupal\system\Hook\SystemHooks::blockViewSystemMainBlockAlter()

Implements hook_block_view_BASE_BLOCK_ID_alter().

Attributes

#[Hook('block_view_system_main_block_alter')]

File

core/modules/system/src/Hook/SystemHooks.php, line 337

Class

SystemHooks
Hook implementations for system.

Namespace

Drupal\system\Hook

Code

public function blockViewSystemMainBlockAlter(array &$build, BlockPluginInterface $block) : void {
  // Contextual links on the system_main block would basically duplicate the
  // tabs/local tasks, so reduce the clutter.
  unset($build['#contextual_links']);
}

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