function tmgmt_content_field_info_alter

Implements hook_field_info_alter().

File

sources/content/tmgmt_content.module, line 435
Source plugin for the Translation Management system that handles entities.

Code

function tmgmt_content_field_info_alter(&$info) {
  if (isset($info['metatag'])) {
    $info['metatag']['tmgmt_field_processor'] = MetatagsFieldProcessor::class;
  }
  if (isset($info['path'])) {
    $info['path']['tmgmt_field_processor'] = PathFieldProcessor::class;
  }
  if (isset($info['link'])) {
    $info['link']['tmgmt_field_processor'] = LinkFieldProcessor::class;
  }

  // Set a default processor class for all fields that do not have one yet.
  foreach ($info as &$field_type) {
    if (!isset($field_type['tmgmt_field_processor'])) {
      $field_type['tmgmt_field_processor'] = DefaultFieldProcessor::class;
    }
  }
}