function taxonomy_unique_form_taxonomy_form_term_alter in Taxonomy unique 7
Implements hook_form_FORM_ID_alter() for taxonomy_form_term().
File
- ./
taxonomy_unique.module, line 51 - Module file for the Taxonomy unique module.
Code
function taxonomy_unique_form_taxonomy_form_term_alter(&$form, &$form_state, $form_id) {
// If the terms in this vocabulary should be unique,
// attach custom validate function to the form.
if (variable_get('taxonomy_unique_' . $form['vocabulary_machine_name']['#value'], FALSE)) {
$form['#validate'][] = 'taxonomy_unique_term_name_validate';
}
}