I'd like to style the username of certain roles differently (mainly admin roles) and I think the way to do it is to append the user roles in the class of the username.
I'd like your help with this because I've tried this but it doesn't work:
function THEME_username(&$vars) {
foreach($vars['user']->roles as $role){
$vars['classes_array'][] = 'role-' . drupal_html_class($role);
}
}
if(count(array_intersect($vars['account']->roles, $target)) > 0) {echo 'works'}
returns an error "Warning: array_intersect() [function.array-intersect]: Argument #1 is not an array". However, is_array($vars['account']->roles) returns true. Could you help me with some suggestions please?