function theme_menu_local_tasks

7.x theme_menu_local_tasks(&$variables)
5.x theme_menu_local_tasks()
6.x theme_menu_local_tasks()
8.x theme_menu_local_tasks(&$variables)

Returns HTML for primary and secondary local tasks.


$variables: An associative array containing:

  • primary: (optional) An array of local tasks (tabs).
  • secondary: (optional) An array of local tasks (tabs).

See also


Related topics

4 string references to the theme hook from theme_menu_local_tasks()

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

drupal_common_theme in drupal/includes/
Provides theme registration for themes across .inc files.
garland_preprocess_page in drupal/themes/garland/template.php
Override or insert variables into the page template.
menu_local_tabs in drupal/includes/
Returns a renderable element for the primary and secondary tabs.
seven_preprocess_page in drupal/themes/seven/template.php
Override or insert variables into the page template.


drupal/includes/, line 2290
API for the Drupal menu system.


function theme_menu_local_tasks(&$variables) {
  $output = '';

  if (!empty($variables['primary'])) {
    $variables['primary']['#prefix'] = '<h2 class="element-invisible">' . t('Primary tabs') . '</h2>';
    $variables['primary']['#prefix'] .= '<ul class="tabs primary">';
    $variables['primary']['#suffix'] = '</ul>';
    $output .= drupal_render($variables['primary']);
  if (!empty($variables['secondary'])) {
    $variables['secondary']['#prefix'] = '<h2 class="element-invisible">' . t('Secondary tabs') . '</h2>';
    $variables['secondary']['#prefix'] .= '<ul class="tabs secondary">';
    $variables['secondary']['#suffix'] = '</ul>';
    $output .= drupal_render($variables['secondary']);

  return $output;