You are here

function menu_local_tabs in Drupal 8

Same name and namespace in other branches
  1. 7 includes/menu.inc \menu_local_tabs()

Returns a renderable element for the primary and secondary tabs.

Deprecated

in drupal:8.8.0 and is removed from drupal:9.0.0. Use local_tasks_block block or inline theming instead.

See also

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

Related topics

1 call to menu_local_tabs()
MenuLegacyTest::testLocalTabs in core/tests/Drupal/KernelTests/Core/Menu/MenuLegacyTest.php
Tests deprecation of the menu_local_tabs() function.

File

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

Code

function menu_local_tabs() {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use local_tasks_block block or inline theming instead. See https://www.drupal.org/node/2874695', E_USER_DEPRECATED);
  $build = [
    '#theme' => 'menu_local_tasks',
    '#primary' => menu_primary_local_tasks(),
    '#secondary' => menu_secondary_local_tasks(),
  ];
  return !empty($build['#primary']) || !empty($build['#secondary']) ? $build : [];
}