Did you know that if you wanted to save extra array data into fields that have been created by the Term Fields module that it WORKS! I was creating a feature request post to ask for this ability, but figured I should try to see if magically it would work. Sure enough it did.

So, maybe this tidbit of information might help someone in the future :)

I only did a couple tests, but this seems to work just fine.

An example:

<?php

$vid = 12;

// Array of $form_value arrays that will be passed to taxonomy_save_term().
$hierarchy = array(
  array(
    'name' => 'United States',
    'description' => 'Country',
    'createdfield1' => '1',
    'createdfield2' => 'abcd'
  ),
  array(
    'name' => 'Massachusetts',
    'description' => 'State',
    'createdfield1' => '3',
    'createdfield2' => 'efgh'
  ),
  array(
    'name' => 'Boston',
    'description' => 'City',
    'createdfield1' => '9',
    'createdfield2' => 'ijkl'
  ),
);

// Adds terms to the tree.
taxonomy_builder_save_terms($vid, $hierarchy);
?>

Comments

mkinnan’s picture

Apparently, I screwed up the link to term fields in my post that I cannot edit.

http://drupal.org/project/term_fields

cpliakas’s picture

Status: Active » Closed (won't fix)

Closed due to end of life announcement.