You are here

function redhen_contact_user_format_name_alter in RedHen CRM 8

Implements hook_user_format_name_alter().

Parameters

$name:

$account:

File

modules/redhen_contact/redhen_contact.module, line 682
Contains redhen_contact.module..

Code

function redhen_contact_user_format_name_alter(&$name, $account) {

  // If RedHen is configured to alter the username of users linked with Contacts.
  if (\Drupal::config('redhen_contact.settings')
    ->get('alter_username') == TRUE) {
    $contact = Contact::loadByUser($account);
    if ($contact) {
      $name = $contact
        ->label();
    }
  }
}