By spatch on
Hi,
as the topic says, I want to add some terms to a vocabulary in my module code.
In the install hook in my module I create a vocabulary but I can't find out how to add some starting entries to it. I've grep'ed through the entire drupal codebase but there is no "INSERT INTO {term_data}" anywhere, which I find odd. How does the data wind up there, because it does indeed.
I've searched everywhere for some decent documentation/tutorial on how to use the taxonomy functions but I cannot find any. Does anyone have some tips?
Thanks!
Comments
The function is
The function is taxonomy_save_term() which is found in taxonomy.module.
Thank you
I did notice it but it was documented as "Helper function for taxonomy_form_term_submit()" so I figured it was just some internal stuff not to be used by others.
When I checked out the code closer, this function uses
drupal_write_record('term_data', ...) which explains why I didn't find any 'INSERT INTO {term_data}'
In case anyone wants to know (and happens to read this), taxonomy_save_term() accepts an array with the following parameters:
@spatch : that was helpful !
@spatch : that was helpful ! Thanks !