You are here

function og_entity_bundle_field_info_alter in Organic groups 8

Implements hook_entity_bundle_field_info_alter().

Set the default field formatter of fields of type OG group.

File

./og.module, line 260

Code

function og_entity_bundle_field_info_alter(&$fields, EntityTypeInterface $entity_type, $bundle) {
  if (!isset($fields['og_group'])) {

    // No OG group fields.
    return;
  }
  $fields['og_group']
    ->setDisplayOptions('view', [
    'weight' => 0,
    'type' => 'og_group_subscribe',
  ])
    ->setDisplayConfigurable('view', TRUE);
}