Modifying CSS class of Menu Block links? The Menu Block offers several hooks to override the markup it generates:

#theme:
  menu_link__menu_block__1
  menu_link__menu_block__main_menu
  menu_link__menu_block
  menu_link__main_menu
  menu_link


However, the variables don't seem to be passed by ref, and if I don't return any string, the links render out null. So, what should I do if I want to just append a custom class to the links and then render them just the default way?

I tried something like in template.php:

function MYTHEME_menu_link__menu_block($variables){
  $variables['element']['#attributes']['class'][] = 'my-class';
  return theme('menu_link__menu_block', $variables['element']['#original_link']);
}


but it causes fatal error.

Any help please?
You would need to copy the whole function. There is a good example on the theme_menu_link() page.

You could also check out the Menu attributes module which allows you to add classes to individual menu items.