function format_username


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 format_username($account)
cle7 format_username($account)
elmsmedia7 format_username($account)
icor7 format_username($account)
meedjum_blog7 format_username($account)
mooc7 format_username($account)

Format a username.

This is also the label callback implementation of callback_entity_info_label() for user_entity_info().

By default, the passed-in object's 'name' property is used if it exists, or else, the site-defined value for the 'anonymous' variable. However, a module may override this by implementing hook_username_alter(&$name, $account).


$account: The account object for the user whose name is to be formatted.

Return value

An unsanitized string with the username to display. The code receiving this result must ensure that check_plain() is called on it before it is printed to the page.

See also


Related topics

39 calls to format_username()
admin_menu_links_account in sites/all/modules/ulmus/admin_menu/
Builds the account links.
blog_feed_user in modules/blog/
Menu callback; displays an RSS feed containing recent blog entries of a given user.
blog_node_view in modules/blog/blog.module
Implements hook_node_view().
blog_page_user in modules/blog/
Menu callback; displays a Drupal page containing recent blog entries of a given user.
blog_user_view in modules/blog/blog.module
Implements hook_user_view().

... See full list

5 string references to 'format_username'
user_entity_info in modules/user/user.module
Implements hook_entity_info().
views_handler_field_user_name::init in sites/all/modules/ulmus/views/modules/user/
Add uid in the query so we can test for anonymous if needed.
views_handler_field_user_name::options_form in sites/all/modules/ulmus/views/modules/user/
Provide link to node option
views_handler_field_user_name::option_definition in sites/all/modules/ulmus/views/modules/user/
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
views_handler_field_user_name::render_link in sites/all/modules/ulmus/views/modules/user/


includes/, line 2106
Common functions that many Drupal modules will need to reference.


function format_username($account) {
  $name = !empty($account->name) ? $account->name : variable_get('anonymous', t('Anonymous'));
  drupal_alter('username', $name, $account);
  return $name;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.