diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module
index a8549ca..2858e49 100644
--- a/core/modules/contact/contact.module
+++ b/core/modules/contact/contact.module
@@ -176,7 +176,7 @@ function contact_mail($key, &$message, $params) {
     '!subject' => $params['subject'],
     '!category' => isset($params['category']['category']) ? $params['category']['category'] : '',
     '!form-url' => url($_GET['q'], array('absolute' => TRUE, 'language' => $language)),
-    '!sender-name' => format_username($params['sender']),
+    '!sender-name' => user_format_name($params['sender']),
     '!sender-url' => $params['sender']->uid ? url('user/' . $params['sender']->uid, array('absolute' => TRUE, 'language' => $language)) : $params['sender']->mail,
   );
 
@@ -196,7 +196,7 @@ function contact_mail($key, &$message, $params) {
     case 'user_mail':
     case 'user_copy':
       $variables += array(
-        '!recipient-name' => format_username($params['recipient']),
+        '!recipient-name' => user_format_name($params['recipient']),
         '!recipient-edit-url' => url('user/' . $params['recipient']->uid . '/edit', array('absolute' => TRUE, 'language' => $language)),
       );
       $message['subject'] .= t('[!site-name] !subject', $variables, array('langcode' => $language->langcode));
diff --git a/core/modules/contact/contact.pages.inc b/core/modules/contact/contact.pages.inc
index a7a6b77..a2927be 100644
--- a/core/modules/contact/contact.pages.inc
+++ b/core/modules/contact/contact.pages.inc
@@ -69,7 +69,7 @@ function contact_site_form($form, &$form_state) {
     '#type' => 'textfield',
     '#title' => t('Your name'),
     '#maxlength' => 255,
-    '#default_value' => $user->uid ? format_username($user) : '',
+    '#default_value' => $user->uid ? user_format_name($user) : '',
     '#required' => TRUE,
   );
   $form['mail'] = array(
@@ -195,7 +195,7 @@ function contact_personal_form($form, &$form_state, $recipient) {
     drupal_exit();
   }
 
-  drupal_set_title(t('Contact @username', array('@username' => format_username($recipient))), PASS_THROUGH);
+  drupal_set_title(t('Contact @username', array('@username' => user_format_name($recipient))), PASS_THROUGH);
 
   if (!$user->uid) {
     $form['#attached']['library'][] = array('system', 'jquery.cookie');
@@ -211,7 +211,7 @@ function contact_personal_form($form, &$form_state, $recipient) {
     '#type' => 'textfield',
     '#title' => t('Your name'),
     '#maxlength' => 255,
-    '#default_value' => $user->uid ? format_username($user) : '',
+    '#default_value' => $user->uid ? user_format_name($user) : '',
     '#required' => TRUE,
   );
   $form['mail'] = array(
diff --git a/core/modules/file/tests/file.test b/core/modules/file/tests/file.test
index a08218d..6ae9963 100644
--- a/core/modules/file/tests/file.test
+++ b/core/modules/file/tests/file.test
@@ -1083,7 +1083,7 @@ class FileTokenReplaceTestCase extends FileFieldTestCase {
     $tests['[file:url]'] = check_plain(file_create_url($file->uri));
     $tests['[file:timestamp]'] = format_date($file->timestamp, 'medium', '', NULL, $language->langcode);
     $tests['[file:timestamp:short]'] = format_date($file->timestamp, 'short', '', NULL, $language->langcode);
-    $tests['[file:owner]'] = check_plain(format_username($this->admin_user));
+    $tests['[file:owner]'] = check_plain(user_format_name($this->admin_user));
     $tests['[file:owner:uid]'] = $file->uid;
 
     // Test to make sure that we generated something for each token.
diff --git a/core/modules/node/node.test b/core/modules/node/node.test
index d018203..f828164 100644
--- a/core/modules/node/node.test
+++ b/core/modules/node/node.test
@@ -2273,9 +2273,9 @@ class NodeTokenReplaceTestCase extends DrupalWebTestCase {
     $tests['[node:language]'] = check_plain($node->language);
     $tests['[node:url]'] = url('node/' . $node->nid, $url_options);
     $tests['[node:edit-url]'] = url('node/' . $node->nid . '/edit', $url_options);
-    $tests['[node:author]'] = check_plain(format_username($account));
+    $tests['[node:author]'] = check_plain(user_format_name($account));
     $tests['[node:author:uid]'] = $node->uid;
-    $tests['[node:author:name]'] = check_plain(format_username($account));
+    $tests['[node:author:name]'] = check_plain(user_format_name($account));
     $tests['[node:created:since]'] = format_interval(REQUEST_TIME - $node->created, 2, $language->langcode);
     $tests['[node:changed:since]'] = format_interval(REQUEST_TIME - $node->changed, 2, $language->langcode);
 
@@ -2292,7 +2292,7 @@ class NodeTokenReplaceTestCase extends DrupalWebTestCase {
     $tests['[node:body]'] = $node->body[$node->language][0]['value'];
     $tests['[node:summary]'] = $node->body[$node->language][0]['summary'];
     $tests['[node:language]'] = $node->language;
-    $tests['[node:author:name]'] = format_username($account);
+    $tests['[node:author:name]'] = user_format_name($account);
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('node' => $node), array('language' => $language, 'sanitize' => FALSE));
diff --git a/core/modules/node/node.tokens.inc b/core/modules/node/node.tokens.inc
index 0603aa2..abe864a 100644
--- a/core/modules/node/node.tokens.inc
+++ b/core/modules/node/node.tokens.inc
@@ -158,7 +158,7 @@ function node_tokens($type, $tokens, array $data = array(), array $options = arr
         // Default values for the chained tokens handled below.
         case 'author':
           $account = user_load($node->uid);
-          $name = format_username($account);
+          $name = user_format_name($account);
           $replacements[$original] = $sanitize ? check_plain($name) : $name;
           break;
 
diff --git a/core/modules/openid/openid.pages.inc b/core/modules/openid/openid.pages.inc
index dcdb3e9..885fe1d 100644
--- a/core/modules/openid/openid.pages.inc
+++ b/core/modules/openid/openid.pages.inc
@@ -27,7 +27,7 @@ function openid_authentication_page() {
  * Menu callback; Manage OpenID identities for the specified user.
  */
 function openid_user_identities($account) {
-  drupal_set_title(format_username($account));
+  drupal_set_title(user_format_name($account));
   drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css');
 
   // Check to see if we got a response
diff --git a/core/modules/php/php.module b/core/modules/php/php.module
index 4c68abe..31065c7 100644
--- a/core/modules/php/php.module
+++ b/core/modules/php/php.module
@@ -113,7 +113,7 @@ print t(\'Welcome visitor! Thank you for visiting.\');
 <pre>
 global $user;
 if ($user->uid) {
-  print t(\'Welcome @name! Thank you for visiting.\', array(\'@name\' => format_username($user)));
+  print t(\'Welcome @name! Thank you for visiting.\', array(\'@name\' => user_format_name($user)));
 }
 else {
   print t(\'Welcome visitor! Thank you for visiting.\');
diff --git a/core/modules/statistics/statistics.pages.inc b/core/modules/statistics/statistics.pages.inc
index bb31f98..1d91609 100644
--- a/core/modules/statistics/statistics.pages.inc
+++ b/core/modules/statistics/statistics.pages.inc
@@ -75,7 +75,7 @@ function statistics_user_tracker() {
         l(t('details'), "admin/reports/access/$log->aid"));
     }
 
-    drupal_set_title(format_username($account));
+    drupal_set_title(user_format_name($account));
     $build['statistics_table'] = array(
       '#theme' => 'table',
       '#header' => $header,
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index 27c79c7..9b9e1b4 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -2024,7 +2024,7 @@ function hook_mail($key, &$message, $params) {
   $context = $params['context'];
   $variables = array(
     '%site_name' => variable_get('site_name', 'Drupal'),
-    '%username' => format_username($account),
+    '%username' => user_format_name($account),
   );
   if ($context['hook'] == 'taxonomy') {
     $entity = $params['entity'];
@@ -3777,28 +3777,6 @@ function hook_url_outbound_alter(&$path, &$options, $original_path) {
 }
 
 /**
- * Alter the username that is displayed for a user.
- *
- * Called by format_username() to allow modules to alter the username that's
- * displayed. Can be used to ensure user privacy in situations where
- * $account->name is too revealing.
- *
- * @param $name
- *   The string that format_username() will return.
- *
- * @param $account
- *   The account object passed to format_username().
- *
- * @see format_username()
- */
-function hook_username_alter(&$name, $account) {
-  // Display the user's uid instead of name.
-  if (isset($account->uid)) {
-    $name = t('User !uid', array('!uid' => $account->uid));
-  }
-}
-
-/**
  * Provide replacement values for placeholder tokens.
  *
  * This hook is invoked when someone calls token_replace(). That function first
diff --git a/core/modules/system/system.tokens.inc b/core/modules/system/system.tokens.inc
index 1d3cd3d..fa95661 100644
--- a/core/modules/system/system.tokens.inc
+++ b/core/modules/system/system.tokens.inc
@@ -250,7 +250,7 @@ function system_tokens($type, $tokens, array $data = array(), array $options = a
 
         case 'owner':
           $account = user_load($file->uid);
-          $name = format_username($account);
+          $name = user_format_name($account);
           $replacements[$original] = $sanitize ? check_plain($name) : $name;
           break;
       }
diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module
index 5151966..254a419 100644
--- a/core/modules/toolbar/toolbar.module
+++ b/core/modules/toolbar/toolbar.module
@@ -221,7 +221,7 @@ function toolbar_view() {
   if ($user->uid) {
     $links = array(
       'account' => array(
-        'title' => t('Hello <strong>@username</strong>', array('@username' => format_username($user))),
+        'title' => t('Hello <strong>@username</strong>', array('@username' => user_format_name($user))),
         'href' => 'user',
         'html' => TRUE,
         'attributes' => array('title' => t('User account')),
diff --git a/core/modules/tracker/tracker.pages.inc b/core/modules/tracker/tracker.pages.inc
index b83adce..e1424c3 100644
--- a/core/modules/tracker/tracker.pages.inc
+++ b/core/modules/tracker/tracker.pages.inc
@@ -18,7 +18,7 @@ function tracker_page($account = NULL, $set_title = FALSE) {
       // When viewed from user/%user/track, display the name of the user
       // as page title -- the tab title remains Track so this needs to be done
       // here and not in the menu definition.
-      drupal_set_title(format_username($account));
+      drupal_set_title(user_format_name($account));
     }
   }
   else {
diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php
index 51237d7..752d3d4 100644
--- a/core/modules/user/user.api.php
+++ b/core/modules/user/user.api.php
@@ -171,6 +171,28 @@ function hook_user_cancel_methods_alter(&$methods) {
 }
 
 /**
+ * Alter the username that is displayed for a user.
+ *
+ * Called by user_format_name() to allow modules to alter the username that's
+ * displayed. Can be used to ensure user privacy in situations where
+ * $account->name is too revealing.
+ *
+ * @param $name
+ *   The string that user_format_name() will return.
+ *
+ * @param $account
+ *   The account object passed to user_format_name().
+ *
+ * @see user_format_name()
+ */
+function hook_user_format_name_alter(&$name, $account) {
+  // Display the user's uid instead of name.
+  if (isset($account->uid)) {
+    $name = t('User !uid', array('!uid' => $account->uid));
+  }
+}
+
+/**
  * Add mass user operations.
  *
  * This hook enables modules to inject custom operations into the mass operations
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 5919b78..aebac2c 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -194,10 +194,10 @@ function user_uri($user) {
  * @return
  *   The name of the user.
  *
- * @see format_username
+ * @see user_format_name()
  */
 function user_label($entity_type, $entity) {
-  return format_username($entity);
+  return user_format_name($entity);
 }
 
 /**
@@ -898,7 +898,7 @@ function user_search_execute($keys = NULL, $conditions = NULL) {
   $results = array();
   foreach ($accounts as $account) {
     $result = array(
-      'title' => format_username($account),
+      'title' => user_format_name($account),
       'link' => url('user/' . $account->uid, array('absolute' => TRUE)),
     );
     if (user_access('administer users')) {
@@ -1376,9 +1376,9 @@ function user_preprocess_block(&$variables) {
  *
  * 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).
+ * may override this by implementing hook_user_format_name_alter(&$name, $account).
  *
- * @see hook_username_alter()
+ * @see hook_user_format_name_alter()
  *
  * @param $account
  *   The account object for the user whose name is to be formatted.
@@ -1388,9 +1388,9 @@ function user_preprocess_block(&$variables) {
  *   this result must ensure that check_plain() is called on it before it is
  *   printed to the page.
  */
-function format_username($account) {
+function user_format_name($account) {
   $name = !empty($account->name) ? $account->name : variable_get('anonymous', t('Anonymous'));
-  drupal_alter('username', $name, $account);
+  drupal_alter('user_format_name', $name, $account);
   return $name;
 }
 
@@ -1426,7 +1426,7 @@ function template_preprocess_user_picture(&$variables) {
       $filepath = variable_get('user_picture_default', '');
     }
     if (isset($filepath)) {
-      $alt = t("@user's picture", array('@user' => format_username($account)));
+      $alt = t("@user's picture", array('@user' => user_format_name($account)));
       // If the image does not have a valid Drupal scheme (for eg. HTTP),
       // don't load image styles.
       if (module_exists('image') && file_valid_uri($filepath) && $style = variable_get('user_picture_style', '')) {
@@ -1471,7 +1471,7 @@ function template_preprocess_username(&$variables) {
   // unsanitized version, in case other preprocess functions want to implement
   // their own shortening logic or add markup. If they do so, they must ensure
   // that $variables['name'] is safe for printing.
-  $name = $variables['name_raw'] = format_username($account);
+  $name = $variables['name_raw'] = user_format_name($account);
   if (drupal_strlen($name) > 20) {
     $name = drupal_substr($name, 0, 15) . '...';
   }
@@ -1983,7 +1983,7 @@ function user_menu_title() {
  * Menu item title callback - use the user name.
  */
 function user_page_title($account) {
-  return is_object($account) ? format_username($account) : '';
+  return is_object($account) ? user_format_name($account) : '';
 }
 
 /**
diff --git a/core/modules/user/user.test b/core/modules/user/user.test
index aa43ffe..367bf82 100644
--- a/core/modules/user/user.test
+++ b/core/modules/user/user.test
@@ -914,7 +914,7 @@ class UserPictureTestCase extends DrupalWebTestCase {
       // user's profile page.
       $text = t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', array('%dimensions' => $test_dim));
       $this->assertRaw($text, t('Image was resized.'));
-      $alt = t("@user's picture", array('@user' => format_username($this->user)));
+      $alt = t("@user's picture", array('@user' => user_format_name($this->user)));
       $style = variable_get('user_picture_style', '');
       $this->assertRaw(image_style_url($style, $pic_path), t("Image is displayed in user's edit page"));
 
@@ -1914,7 +1914,7 @@ class UserTokenReplaceTestCase extends DrupalWebTestCase {
     // Generate and test sanitized tokens.
     $tests = array();
     $tests['[user:uid]'] = $account->uid;
-    $tests['[user:name]'] = check_plain(format_username($account));
+    $tests['[user:name]'] = check_plain(user_format_name($account));
     $tests['[user:mail]'] = check_plain($account->mail);
     $tests['[user:url]'] = url("user/$account->uid", $url_options);
     $tests['[user:edit-url]'] = url("user/$account->uid/edit", $url_options);
@@ -1922,7 +1922,7 @@ class UserTokenReplaceTestCase extends DrupalWebTestCase {
     $tests['[user:last-login:short]'] = format_date($account->login, 'short', '', NULL, $language->langcode);
     $tests['[user:created]'] = format_date($account->created, 'medium', '', NULL, $language->langcode);
     $tests['[user:created:short]'] = format_date($account->created, 'short', '', NULL, $language->langcode);
-    $tests['[current-user:name]'] = check_plain(format_username($global_account));
+    $tests['[current-user:name]'] = check_plain(user_format_name($global_account));
 
     // Test to make sure that we generated something for each token.
     $this->assertFalse(in_array(0, array_map('strlen', $tests)), t('No empty tokens generated.'));
@@ -1933,9 +1933,9 @@ class UserTokenReplaceTestCase extends DrupalWebTestCase {
     }
 
     // Generate and test unsanitized tokens.
-    $tests['[user:name]'] = format_username($account);
+    $tests['[user:name]'] = user_format_name($account);
     $tests['[user:mail]'] = $account->mail;
-    $tests['[current-user:name]'] = format_username($global_account);
+    $tests['[current-user:name]'] = user_format_name($global_account);
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('user' => $account), array('language' => $language, 'sanitize' => FALSE));
diff --git a/core/modules/user/user.tokens.inc b/core/modules/user/user.tokens.inc
index ac7f420..76ec4a2 100644
--- a/core/modules/user/user.tokens.inc
+++ b/core/modules/user/user.tokens.inc
@@ -85,7 +85,7 @@ function user_tokens($type, $tokens, array $data = array(), array $options = arr
           break;
 
         case 'name':
-          $name = format_username($account);
+          $name = user_format_name($account);
           $replacements[$original] = $sanitize ? check_plain($name) : $name;
           break;
 
