-
-
Save gormus/975c7fabb9e1e585cae55e64186417e7 to your computer and use it in GitHub Desktop.
HTML in menu items D8
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__main') { | |
| $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', 'b', 'i'), | |
| ); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment