diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 2fd7b52..404cf3b 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -1665,6 +1665,23 @@ function theme_menu_local_action($variables) { } /** + * Preprocess variables for a single local action link. + */ +function theme_menu_local_action($variables) { + $link = $variables['element']['#link']; + + if (isset($link['href'])) { + $variables['link'] = l($link['title'], $link['href'], isset($link['localized_options']) ? $link['localized_options'] : array()); + } + elseif (!empty($link['localized_options']['html'])) { + $variables['link'] = $link['title']; + } + else { + $variables['link'] = check_plain($link['title']); + } +} + +/** * Generates elements for the $arg array in the help hook. */ function drupal_help_arg($arg = array()) { diff --git a/core/themes/stark/templates/menu.inc/menu-local-action.html.twig b/core/themes/stark/templates/menu.inc/menu-local-action.html.twig new file mode 100644 index 0000000..45b9358 --- /dev/null +++ b/core/themes/stark/templates/menu.inc/menu-local-action.html.twig @@ -0,0 +1,15 @@ +{# +/** + * @file + * Default theme implementation for a single local action link. + * + * Available variables: + * - link: A rendered link element. + * + * @see template_preprocess + * @see template_preprocess_menu_local_action + * + * @ingroup themeable + */ +#} +
  • {{ link }}