WordPress.org

Support

Support » Plugins and Hacks » CSV Importer » custom taxonomies small hack

custom taxonomies small hack

  • 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/

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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?

    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…

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘custom taxonomies small hack’ is closed to new replies.
Skip to toolbar