You are here

function metatag_entity_translation_delete in Metatag 7

Implements hook_entity_translation_delete().

File

./metatag.module, line 3047
Primary hook implementations for Metatag.

Code

function metatag_entity_translation_delete($entity_type, $entity, $langcode) {

  // Required for content translations being handled via Entity_Translation to
  // remove the appropriate record when a translation is removed without the
  // corresponding entity record also being removed.
  // Get the entity's ID.
  list($entity_id, $revision_id) = entity_extract_ids($entity_type, $entity);
  $revision_id = intval($revision_id);

  // Delete the translation.
  metatag_metatags_delete($entity_type, $entity_id, $revision_id, $langcode);
}