jsonapi_test_user.module

Same filename in other branches
  1. 8.9.x core/modules/jsonapi/tests/modules/jsonapi_test_user/jsonapi_test_user.module
  2. 10 core/modules/jsonapi/tests/modules/jsonapi_test_user/jsonapi_test_user.module
  3. 11.x core/modules/jsonapi/tests/modules/jsonapi_test_user/jsonapi_test_user.module

Support module for JSON:API user hooks testing.

File

core/modules/jsonapi/tests/modules/jsonapi_test_user/jsonapi_test_user.module

View source
<?php


/**
 * @file
 * Support module for JSON:API user hooks testing.
 */
use Drupal\Core\Session\AccountInterface;

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

Functions

Title Deprecated Summary
jsonapi_test_user_user_format_name_alter Implements hook_user_format_name_alter().

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