hook_field_attach_prepare_translation_alter
function hook_field_attach_prepare_translation_alter
hook_field_attach_prepare_translation_alter(&$entity, $context)
Perform alterations on field_attach_prepare_translation().
This hook is invoked after the field module has performed the operation.
Parameters
$entity: The entity being prepared for translation.
$context: An associative array containing:
- entity_type: The type of $entity; e.g. 'node' or 'user'.
- langcode: The language the entity has to be translated in.
- source_entity: The entity holding the field values to be translated.
- source_langcode: The source language from which translate.
Related topics
File
- modules/field/field.api.php, line 1534
- Hooks provided by the Field module.
Code
function hook_field_attach_prepare_translation_alter(&$entity, $context) { if ($context['entity_type'] == 'custom_entity_type') { $entity->custom_field = $context['source_entity']->custom_field; } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!field!field.api.php/function/hook_field_attach_prepare_translation_alter/7.x