taxonomy_test_form_alter

7 taxonomy_test.module taxonomy_test_form_alter(&$form, $form_state, $form_id)
8 taxonomy_test.module taxonomy_test_form_alter(&$form, $form_state, $form_id)

Implements hook_form_alter().

File

modules/simpletest/tests/taxonomy_test.module, line 60
Test module for Taxonomy hooks and functions not used in core.

Code

function taxonomy_test_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'taxonomy_form_term') {
    $antonym = taxonomy_test_get_antonym($form['#term']['tid']);
    $form['advanced']['antonym'] = array(
      '#type' => 'textfield', 
      '#title' => t('Antonym'), 
      '#default_value' => !empty($antonym) ? $antonym : '', 
      '#description' => t('Antonym of this term.'),
    );
  }
}
Login or register to post comments