Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / menu_links_discovered_alter.twig
1 /**
2  * Implements hook_menu_links_discovered_alter().
3  */
4 function {{ machine_name }}_menu_links_discovered_alter(&$links) {
5   // Change the weight and title of the user.logout link.
6   $links['user.logout']['weight'] = -10;
7   $links['user.logout']['title'] = new \Drupal\Core\StringTranslation\TranslatableMarkup('Logout');
8   // Conditionally add an additional link with a title that's not translated.
9   if (\Drupal::moduleHandler()->moduleExists('search')) {
10     $links['menu.api.search'] = [
11       'title' => \Drupal::config('system.site')->get('name'),
12       'route_name' => 'menu.api.search',
13       'description' => new \Drupal\Core\StringTranslation\TranslatableMarkup('View popular search phrases for this site.'),
14       'parent' => 'system.admin_reports',
15     ];
16   }
17 }