WordPress.org

Ready to get started?Download WordPress

Forums

CSV Importer
custom taxonomies small hack (4 posts)

  1. lizuka
    Member
    Posted 1 year 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 :)

    http://wordpress.org/extend/plugins/csv-importer/

  2. bheadrick
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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

About this Topic

Tags

No tags yet.