parent.inc 438 B

12345678910111213141516171819
  1. <?php
  2. /**
  3. * @file
  4. * Plugin definition for duplicate suggestion based on parents.
  5. */
  6. $plugin = array(
  7. 'title' => t('Terms parents are the same'),
  8. 'description' => t('Mark terms as duplicates if they have the same parent.'),
  9. 'hash callback' => 'term_merge_duplicate_suggestion_parent_hash',
  10. );
  11. /**
  12. * Hash term based on its parent.
  13. */
  14. function term_merge_duplicate_suggestion_parent_hash($term) {
  15. return $term->parents[0];
  16. }