Last active
December 25, 2015 14:39
-
-
Save dirtystylus/6993164 to your computer and use it in GitHub Desktop.
Pulls the class elements from child <a> element and puts them on the parent <li> item. Useful if you want classes you added with the menu_attributes module to be used on the parent <li>, since those classes are placed on the <a> element itself.
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
function THEME_preprocess_menu_link(&$variables) { | |
$element = &$variables['element']; | |
if (!empty($element['#original_link']['options']['attributes']['class'])) { | |
foreach($element['#original_link']['options']['attributes']['class'] as $class) { | |
$element['#attributes']['class'][] = $class; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment