function taxonomy_test_taxonomy_term_insert

7.x taxonomy_test.module taxonomy_test_taxonomy_term_insert($term)

Implements hook_taxonomy_term_insert().

File

drupal-7.x/modules/simpletest/tests/taxonomy_test.module, line 25
Test module for Taxonomy hooks and functions not used in core.

Code

function taxonomy_test_taxonomy_term_insert($term) {
  if (!empty($term->antonym)) {
    db_insert('taxonomy_term_antonym')
      ->fields(array(
        'tid' => $term->tid,
        'name' => trim($term->antonym)
      ))
      ->execute();
  }
}