8.5.x menu.inc menu_secondary_local_tasks()
8.0.x menu.inc menu_secondary_local_tasks()
8.1.x menu.inc menu_secondary_local_tasks()
8.2.x menu.inc menu_secondary_local_tasks()
8.3.x menu.inc menu_secondary_local_tasks()
8.4.x menu.inc menu_secondary_local_tasks()
8.6.x menu.inc menu_secondary_local_tasks()
4.6.x menu.inc menu_secondary_local_tasks()
4.7.x menu.inc menu_secondary_local_tasks()
5.x menu.inc menu_secondary_local_tasks()
6.x menu.inc menu_secondary_local_tasks()
7.x menu.inc menu_secondary_local_tasks()

Returns the rendered local tasks at the second level.

Deprecated

in Drupal 8.0.0, will be removed before Drupal 9.0.0.

See also

https://www.drupal.org/node/2874695

Related topics

1 call to menu_secondary_local_tasks()
menu_local_tabs in core/includes/menu.inc
Returns a renderable element for the primary and secondary tabs.

File

core/includes/menu.inc, line 139
API for the Drupal menu system.

Code

function menu_secondary_local_tasks() {

  /** @var \Drupal\Core\Menu\LocalTaskManagerInterface $manager */
  $manager = \Drupal::service('plugin.manager.menu.local_task');
  $links = $manager
    ->getLocalTasks(\Drupal::routeMatch()
    ->getRouteName(), 1);

  // Do not display single tabs.
  return count(Element::getVisibleChildren($links['tabs'])) > 1 ? $links['tabs'] : '';
}