function JsonapiTestUserHooks::userFormatNameAlter

Implements hook_user_format_name_alter().

File

core/modules/jsonapi/tests/modules/jsonapi_test_user/src/Hook/JsonapiTestUserHooks.php, line 18

Class

JsonapiTestUserHooks
Hook implementations for jsonapi_test_user.

Namespace

Drupal\jsonapi_test_user\Hook

Code

public function userFormatNameAlter(&$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.