1 taxonomy.module taxonomy_menu_local_tasks_alter(&$data, $router_item, $root_path)

Implements hook_menu_local_tasks_alter().

File

core/modules/taxonomy/taxonomy.module, line 1462
Enables the organization of content into categories.

Code

function taxonomy_menu_local_tasks_alter(&$data, $router_item, $root_path) {
  // Add language code to the "Add term" action link under
  // admin/structure/taxonomy/[taxonomy-name].
  if (module_exists('language')) {
    if ($root_path == 'admin/structure/taxonomy/%') {
      foreach ($data['actions']['output'] as $key => $action_link) {
        if ($action_link['#link']['path'] === 'admin/structure/taxonomy/%/add') {
          $default_langcode = isset($_GET['langcode_term']) ? $_GET['langcode_term'] : LANGUAGE_NONE;
          $query['langcode_term'] = $default_langcode;
          $data['actions']['output'][$key]['#link']['localized_options'] = array('query' => $query);
        }
      }
    }
  }
}