term_merge.api.php 889 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * @file
  4. * Documentation for Term Merge module.
  5. */
  6. /**
  7. * Notify other modules when merging of 2 taxonomy terms occurs.
  8. *
  9. * @param object $term_trunk
  10. * Fully loaded taxonomy term object of the term trunk, term into which
  11. * merging occurs, aka 'destination'
  12. * @param object $term_branch
  13. * Fully loaded taxonomy term object of the term branch, term that is being
  14. * merged, aka 'source'
  15. * @param array $context
  16. * Array $context as it is passed to term_merge_action() - you can get a
  17. * little more info about context about merging from this array
  18. */
  19. function hook_term_merge($term_trunk, $term_branch, $context) {
  20. // Here we might want to run a query like:
  21. // UPDATE {my_table}
  22. // SET term_tid = $term_trunk->tid
  23. // WHERE term_tid = $term_branch->tid
  24. // Or do anything else that you own logic requires when merging of 2 terms
  25. // happens.
  26. }