taxonomy_form_term_submit

Versions
4.7 – 5
taxonomy_form_term_submit($form_id, $form_values)
6 – 7
taxonomy_form_term_submit($form, &$form_state)

Accept the form submission for a taxonomy term and save the result.

Code

modules/taxonomy/taxonomy.module, line 468

<?php
function taxonomy_form_term_submit($form_id, $form_values) {
  switch (taxonomy_save_term($form_values)) {
    case SAVED_NEW:
      drupal_set_message(t('Created new term %term.', array('%term' => $form_values['name'])));
      watchdog('taxonomy', t('Created new term %term.', array('%term' => $form_values['name'])), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/term/'. $form_values['tid']));
      break;
    case SAVED_UPDATED:
      drupal_set_message(t('Updated term %term.', array('%term' => $form_values['name'])));
      watchdog('taxonomy', t('Updated term %term.', array('%term' => $form_values['name'])), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/term/'. $form_values['tid']));
      break;
  }
  return 'admin/content/taxonomy';
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.