You are here

function smart_title_entity_base_field_info_alter in Smart Title 8

Implements hook_entity_base_field_info_alter().

Alter created and uid base fields: making them configurable for view display context.

File

./smart_title.module, line 148
Contains hooks and private functions of smart_title.module.

Code

function smart_title_entity_base_field_info_alter(&$fields, EntityTypeInterface $entity_type) {
  foreach (_smart_title_view_configurable_base_fields($entity_type
    ->id()) as $field_name) {
    if (!empty($fields[$field_name])) {
      $view_display_options = $fields[$field_name]
        ->getDisplayOptions('view');
      $view_display_options['type'] = 'hidden';
      $fields[$field_name]
        ->setDisplayOptions('view', $view_display_options);
      $fields[$field_name]
        ->setDisplayConfigurable('view', TRUE);
    }
  }
}