Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / field_prepare_translation.twig
1 /**
2  * Implements hook_field_prepare_translation().
3  */
4 function {{ machine_name }}_field_prepare_translation($entity_type, $entity, $field, $instance, $langcode, &$items, $source_entity, $source_langcode) {
5   // If the translating user is not permitted to use the assigned text format,
6   // we must not expose the source values.
7   $field_name = $field['field_name'];
8   $formats = filter_formats();
9   $format_id = $source_entity->{$field_name}[$source_langcode][0]['format'];
10   if (!filter_access($formats[$format_id])) {
11     $items = array();
12   }
13 }