You are here

function party_user_username_alter in Party 8.2

Same name and namespace in other branches
  1. 7 modules/party_user/party_user.module \party_user_username_alter()

Implements hook_username_alter().

File

modules/party_user/party_user.module, line 313
Support for linking users to parties

Code

function party_user_username_alter(&$name, $account) {
  if (!variable_get('party_user_format_username', TRUE)) {
    return;
  }
  else {
    if (!($party = party_user_get_party($account))) {
      return;
    }
    else {
      if (empty($party->label)) {
        return;
      }
    }
  }
  $name = $party->label;
}