8.5.x menu.api.php hook_local_tasks_alter(&$local_tasks)
8.0.x menu.api.php hook_local_tasks_alter(&$local_tasks)
8.1.x menu.api.php hook_local_tasks_alter(&$local_tasks)
8.2.x menu.api.php hook_local_tasks_alter(&$local_tasks)
8.3.x menu.api.php hook_local_tasks_alter(&$local_tasks)
8.4.x menu.api.php hook_local_tasks_alter(&$local_tasks)
8.6.x menu.api.php hook_local_tasks_alter(&$local_tasks)

Alter local tasks plugins.

Parameters

array $local_tasks: The array of local tasks plugin definitions, keyed by plugin ID.

See also

\Drupal\Core\Menu\LocalTaskInterface

\Drupal\Core\Menu\LocalTaskManager

Related topics

4 functions implement hook_local_tasks_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

contact_menu_local_tasks_alter in core/modules/contact/contact.module
Implements hook_menu_local_tasks_alter().
field_ui_local_tasks_alter in core/modules/field_ui/field_ui.module
Implements hook_local_tasks_alter().
menu_test_menu_local_tasks_alter in core/modules/system/tests/modules/menu_test/menu_test.module
Implements hook_menu_local_tasks_alter().
views_local_tasks_alter in core/modules/views/views.module
Implements hook_local_tasks_alter().
1 invocation of hook_local_tasks_alter()

File

core/lib/Drupal/Core/Menu/menu.api.php, line 350
Hooks and documentation related to the menu system and links.

Code

function hook_local_tasks_alter(&$local_tasks) {

  // Remove a specified local task plugin.
  unset($local_tasks['example_plugin_id']);
}