function menu_block_view_system_menu_block_alter

Implements hook_block_view_BASE_BLOCK_ID_alter() for 'system_menu_block'.

File

drupal/core/modules/menu/menu.module, line 420
Allows administrators to customize the site's navigation menus.

Code

function menu_block_view_system_menu_block_alter(array &$build, BlockPluginInterface $block) {

  // Add contextual links for system menu blocks.
  if (isset($build['content'])) {
    foreach (element_children($build['content']) as $key) {
      $build['content']['#contextual_links']['menu'] = array(
        'admin/structure/menu/manage',
        array(
          $build['content'][$key]['#original_link']['menu_name'],
        ),
      );
    }
  }
}