function theme_menu_link

7.x theme_menu_link(array $variables)
8.x theme_menu_link(array $variables)

Returns HTML for a menu link and submenu.


$variables: An associative array containing:

  • element: Structured array data for a menu link.

Related topics

4 string references to the theme hook from theme_menu_link()

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.
MenuTreeOutputTestCase::testMenuTreeData in drupal/modules/simpletest/tests/menu.test
Validate the generation of a proper menu tree output.
menu_link_save in drupal/includes/
Saves a menu link.
menu_tree_output in drupal/includes/
Returns an output structure for rendering a menu tree.


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


function theme_menu_link(array $variables) {
  $element = $variables['element'];
  $sub_menu = '';

  if ($element['#below']) {
    $sub_menu = drupal_render($element['#below']);
  $output = l($element['#title'], $element['#href'], $element['#localized_options']);
  return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";