aksamvel
10/2/2014 - 5:54 AM

Create programmatically taxonomy term

Create programmatically taxonomy term

  $vocabulary = taxonomy_vocabulary_machine_name_load('vocabulary_name');
  $term = new stdClass();
  $term->name = 'term_name';
  $term->vid = $vocabulary->vid;
  // Append next line, if term havent FO page.
  $term->path['pathauto'] = FALSE;
  taxonomy_term_save($term);