Taxonomy Section Custom Drupal Code
Submitted by Sam Rose on Sun, 02/08/2009 - 23:27
$taxo_section_string = $taxo_section; $taxo_section_tids = taxonomy_get_term_by_name($taxo_section_string); if (!$taxo_section_tids) { // add section into this issue // this will only occur with new section names $status = taxonomy_save_term($form_values); $taxo_section_tids = taxonomy_get_term_by_name($taxo_section_string); foreach ($taxo_section_tids as $item) { $this_taxo_section_tid = $item->tid; $this_parent_tids = taxonomy_get_parents($this_taxo_section_tid); foreach ($this_parent_tids as $this_parent_tid) { if ($this_parent_tid->tid == $taxo_section_tid) { $taxo_section_tid = $this_taxo_section_tid; } } }
Original location:
none
- Login to post comments

