function taxonomy_term_confirm_delete_submit

Submit handler to delete a term after confirmation.

See also

taxonomy_term_confirm_delete()

File

drupal/core/modules/taxonomy/taxonomy.admin.inc, line 433
Administrative page callbacks for the taxonomy module.

Code

function taxonomy_term_confirm_delete_submit($form, &$form_state) {
  entity_delete_multiple('taxonomy_term', array(
    $form_state['values']['tid'],
  ));
  taxonomy_check_vocabulary_hierarchy($form_state['taxonomy']['vocabulary'], $form_state['values']);
  drupal_set_message(t('Deleted term %name.', array(
    '%name' => $form_state['values']['name'],
  )));
  watchdog('taxonomy', 'Deleted term %name.', array(
    '%name' => $form_state['values']['name'],
  ), WATCHDOG_NOTICE);
  if (!isset($_GET['destination'])) {
    $form_state['redirect'] = 'admin/structure/taxonomy';
  }
  cache_invalidate_tags(array(
    'content' => TRUE,
  ));
  return;
}