Last active
July 6, 2016 21:50
-
-
Save jacine/bc48f1ccf004b2d84e54ae6b4193ea8a to your computer and use it in GitHub Desktop.
Give me my HTML in my Drupal 8 menu links!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_preprocess_menu(). | |
*/ | |
function THEME_preprocess_menu(&$vars, $hook) { | |
if ($hook == 'menu__account') { | |
$items = $vars['items']; | |
foreach ($items as $key => $item) { | |
if ($key == 'user.page') { | |
$vars['items'][$key]['title'] = array( | |
'#markup' => 'Log the <i>fuck</i> in!', | |
'#allowed_tags' => array('i'), | |
); | |
} | |
if ($key == 'user.logout') { | |
$vars['items'][$key]['title'] = array( | |
'#markup' => 'Log the <i>fuck</i> out!', | |
'#allowed_tags' => array('i'), | |
); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment