CSV Importer
custom taxonomies small hack (4 posts)

  1. lizuka
    Posted 2 years ago #

    After reading a few of the comments about the problem with custom taxonomies and the need to format their columns appending '0,' before the taxonomy name, I made a small adjustment in the csv_importer.php file, after line 396 I added this line :
    $term_ids[] = $parent_info['term_id'];
    This will save the parent taxonomy correctly.
    Hope this will help some of you :)


  2. bheadrick
    Posted 2 years ago #

    I assume that requiring the prepending of 0 is to differentiate between hierarchical and non-hierarchical taxonomies. Have you tested this modification with both types?

  3. lizuka
    Posted 2 years ago #

    I only tested with hierarchical taxonomies but I added this line of code within the condition :
    if (is_taxonomy_hierarchical($taxonomy)) {
    so it shouldn't affect non-hierarchical taxonomies...

  4. stonebug
    Posted 2 years ago #

    I tried it and it worked for me. It created the custom taxonomy and mapped the post to the non hierarchical taxonomy (category) created.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • CSV Importer
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.