You are here

function scheduler_field_attach_prepare_translation_alter in Scheduler 7

Implements hook_field_attach_prepare_translation_alter().

File

./scheduler.module, line 932
Scheduler publishes and unpublishes nodes on dates specified by the user.

Code

function scheduler_field_attach_prepare_translation_alter($entity, $context) {

  // Prefill the node translation form with values from the translation source
  // node.
  $source_entity = $context['source_entity'];
  if (isset($source_entity->publish_on)) {
    $entity->publish_on = $source_entity->publish_on;
  }
  if (isset($source_entity->unpublish_on)) {
    $entity->unpublish_on = $source_entity->unpublish_on;
  }
}