Skip to content

Instantly share code, notes, and snippets.

@mortendk
Created May 2, 2016 18:34
Show Gist options
  • Select an option

  • Save mortendk/0d9ff4426c8c82221b2b2ad1cfe80f47 to your computer and use it in GitHub Desktop.

Select an option

Save mortendk/0d9ff4426c8c82221b2b2ad1cfe80f47 to your computer and use it in GitHub Desktop.
/**
* Implements hook_preprocess_menu().
*/
function vanilla_preprocess_menu(&$vars, $hook) {
if ($hook == 'menu_main') {
kint($hook);
$items = $vars['items'];
foreach ($items as $key => $item) {
$original_title = $vars['items'][$key]['title'];
$vars['items'][$key]['title'] = array(
'#markup' => $original_title,
'#allowed_tags' => array('span', 'svg', 'use'),
);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment