1 taxonomy.admin.inc taxonomy_form_term_submit_build_taxonomy_term($form, &$form_state)

Updates the form state's term entity by processing this submission's values.

File

core/modules/taxonomy/taxonomy.admin.inc, line 971
Admin page callbacks for the Taxonomy module.

Code

function taxonomy_form_term_submit_build_taxonomy_term($form, &$form_state) {
  $term = $form_state['term'];
  entity_form_submit_build_entity('taxonomy_term', $term, $form, $form_state);

  // Prevent leading and trailing spaces in term names.
  $term->name = trim($term->name);

  // Convert text_format field into values expected by taxonomy_term_save().
  $description = $form_state['values']['description'];
  $term->description = $description['value'];
  $term->format = $description['format'];
  return $term;
}