You are here

function show_email_entity_base_field_info_alter in Show Email Address 8

Implements hook_entity_base_field_info_alter().

File

./show_email.module, line 27
Show registered user email address in profile page.

Code

function show_email_entity_base_field_info_alter(&$fields, $entity_type) {

  // If entity is user show email address.
  if ($entity_type
    ->id() == 'user') {
    if (isset($fields['mail'])) {
      $fields['mail']
        ->setDisplayConfigurable('view', TRUE)
        ->setTargetEntityTypeId('user');
    }
  }
}