Fix for theme_username RDFa

  1. function theme_username($variables) {
  2.   if (isset($variables['link_path'])) {
  3.     // We have a link path, so we should generate a link using l().
  4.     // Additional classes may be added as array elements like
  5.     // $variables['link_options']['attributes']['class'][] = 'myclass';
  6.     $output = l($variables['name'] . $variables['extra'], $variables['link_path'], $variables['link_options']);
  7.   }
  8.   else {
  9.     // Modules may have added important attributes so they must be included
  10.     // in the output. Additional classes may be added as array elements like
  11.     // $variables['attributes_array']['class'][] = 'myclass';
  12.     $output = '<span' . drupal_attributes($variables['attributes_array']) . '>' . $variables['name'] . $variables['extra'] . '</span>';
  13.   }
  14.  
  15.   // Some modules might want to wrap the username with an extra span.
  16.   if (!empty($variables['parent_attributes_array'])) {
  17.     $output = '<span' . drupal_attributes($variables['parent_attributes_array']) . '>' . $output . '</span>';
  18.   }
  19.  
  20.   return $output;
  21. }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.