-
-
Save gormus/4df29aed7351aaf490e3ecd44fce696e to your computer and use it in GitHub Desktop.
Give me my HTML in my Drupal 8 menu links!
This file contains hidden or 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