| 1 menu.module | menu_menu_local_tasks_alter(&$data, $router_item, $root_path) | 
        
Implements hook_menu_local_tasks_alter().
File
- core/
modules/ menu/ menu.module, line 557  - Allows administrators to customize the site's menus.
 
Code
function menu_menu_local_tasks_alter(&$data, $router_item, $root_path) {
  // Add language code to the "Add link" action link under
  // admin/structure/menu/manage/[menu-name].
  if ($root_path == 'admin/structure/menu/manage/%') {
    foreach ($data['actions']['output'] as $key => $action_link) {
      if ($action_link['#link']['path'] === 'admin/structure/menu/manage/%/add') {
        $default_langcode = isset($_GET['langcode']) ? $_GET['langcode'] : LANGUAGE_NONE;
        $query['langcode'] = $default_langcode;
        $data['actions']['output'][$key]['#link']['localized_options'] = array('query' => $query);
      }
    }
  }
}