function NavigationHooks::menuLinksDiscoveredAlter

Implements hook_menu_links_discovered_alter().

File

core/modules/navigation/src/Hook/NavigationHooks.php, line 107

Class

NavigationHooks
Hook implementations for navigation.

Namespace

Drupal\navigation\Hook

Code

public function menuLinksDiscoveredAlter(&$links) : void {
    $navigation_links = \Drupal::classResolver(NavigationContentLinks::class);
    assert($navigation_links instanceof NavigationContentLinks);
    $navigation_links->addMenuLinks($links);
    $navigation_links->removeAdminContentLink($links);
    $navigation_links->removeHelpLink($links);
}

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