function TextWithSummaryHooks::fieldFormatterInfoAlter

Implements hook_field_formatter_info_alter().

Attributes

#[Hook('field_formatter_info_alter')]

File

core/modules/text_with_summary/src/Hook/TextWithSummaryHooks.php, line 62

Class

TextWithSummaryHooks
Hook implementations for text_with_summary.

Namespace

Drupal\text_with_summary\Hook

Code

public function fieldFormatterInfoAlter(&$info) : void {
  if (isset($info['text_default'])) {
    $info['text_default']['field_types'][] = 'text_with_summary';
  }
  if (isset($info['text_trimmed'])) {
    $info['text_trimmed']['field_types'][] = 'text_with_summary';
  }
}

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