Using theme_username() with no link to user page? I use this theme function to show the username of user:

 theme('username', array('account' =&gt; user_load($record-&gt;uid)))),


It works fine but the username is also a link to the user page. I just need to the username with no link at all.

I read the doc at: 

http://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_username/7

and I see that there is the argument link_options to handle this, then I guessed it was a bolean value and tried with (but not working):

theme('username', array('account' =&gt; user_load($record-&gt;uid), 'link_options' =&gt; 0))),
theme_username() will only output the username as a link if the link_path variable has been set. This is done by default in template_preprocess_username(), and will happen as long as the user viewing the username has access to view the profile.

If you want to change that behaviour you just need to add your own preprocess function which removes the link_path variable:

function MYTHEME_preprocess_username(&amp;$vars) {
  if (isset($vars['link_path'])) {
    unset($vars['link_path']);
  }
}


Bear in mind that the above will remove the link system wide. If you want to remove just for this specific instance, I think the best way would be to pass a custom variable to the theme function and check for it in your preprocess function:

$vars = array('account' = user_load($record-&gt;uid), 'surpress_link' =&gt; TRUE);
$name = theme('username', $vars);

function MYTHEME_preprocess_username(&amp;$vars) {
  if (isset($vars['link_path']) &amp;&amp; isset($vars['surpress_link']) &amp;&amp; $vars['surpress_link']) {
    unset($vars['link_path']);
  }
}