function jsonapi_test_user_user_format_name_alter

Same name in other branches
  1. 9 core/modules/jsonapi/tests/modules/jsonapi_test_user/jsonapi_test_user.module \jsonapi_test_user_user_format_name_alter()
  2. 10 core/modules/jsonapi/tests/modules/jsonapi_test_user/jsonapi_test_user.module \jsonapi_test_user_user_format_name_alter()
  3. 11.x core/modules/jsonapi/tests/modules/jsonapi_test_user/jsonapi_test_user.module \jsonapi_test_user_user_format_name_alter()

Implements hook_user_format_name_alter().

File

core/modules/jsonapi/tests/modules/jsonapi_test_user/jsonapi_test_user.module, line 13

Code

function jsonapi_test_user_user_format_name_alter(&$name, AccountInterface $account) {
    if ($account->isAnonymous()) {
        $name = 'User ' . $account->id();
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.