Created
November 29, 2016 15:12
-
-
Save jenter/ab92f58b46ce9854f46d459c423b1ca1 to your computer and use it in GitHub Desktop.
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
/** | |
* Implements hook_preprocess_html(). | |
*/ | |
function MYTHEME_preprocess_html(&$variables) { | |
// Body classes for auth roles. | |
if ($variables['logged_in']) { | |
$user_roles = user_role_names(TRUE); | |
foreach ($user_roles as $role => $title) { | |
$variables['attributes']['class'][] = Html::cleanCssIdentifier('role--' . $role); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment