hook_local_tasks_alter

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

Hooks
Define functions that alter the behavior of Drupal core.
Menu system
Define the navigation menus, local actions and tasks, and contextual links.

File

core/lib/Drupal/Core/Menu/menu.api.php, line 349
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']);
}
doc_Drupal
2016-10-29 09:18:20
Comments
Leave a Comment

Please login to continue.