Form builder for the term delete form.
taxonomy_term_confirm_delete_submit()
function taxonomy_term_confirm_delete($form, &$form_state, Term $term) {
// Always provide entity id in the same form key as in the entity edit form.
$form['tid'] = array(
'#type' => 'value',
'#value' => $term
->id(),
);
$form_state['taxonomy']['vocabulary'] = taxonomy_vocabulary_load($term
->bundle());
$form['type'] = array(
'#type' => 'value',
'#value' => 'term',
);
$form['name'] = array(
'#type' => 'value',
'#value' => $term
->label(),
);
$form['vid'] = array(
'#type' => 'value',
'#value' => $term
->bundle(),
);
$form['delete'] = array(
'#type' => 'value',
'#value' => TRUE,
);
return confirm_form($form, t('Are you sure you want to delete the term %title?', array(
'%title' => $term
->label(),
)), 'admin/structure/taxonomy', t('Deleting a term will delete all its children if there are any. This action cannot be undone.'), t('Delete'), t('Cancel'));
}