Support » Plugin: CSV Importer » Loading with parent-only term in hierarchical taxonomy

  • I’m loading posts that belong to the parent term in a hierarchical taxonomy. If they do not belong to a child term, then they are not added to the list of term_ids to assign the post to.

    I changed csv_importer.php around line 410 from:

    if ($parent_ok) {
                        $child_info = $this->term_exists($child, $taxonomy, $parent_id);

    To:

    if ($parent_ok) {
                        if( !$child )
                          $term_ids[] = $parent_id;
    
                        $child_info = $this->term_exists($child, $taxonomy, $parent_id);

    A bit cheap and dirty, but it did the trick for me.

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

  • The topic ‘Loading with parent-only term in hierarchical taxonomy’ is closed to new replies.