fix csv import when the taxonomy has empty value

This commit is contained in:
vnmedeiros 2018-10-30 10:24:07 -03:00
parent 855b83055b
commit 6527b6c942
1 changed files with 1 additions and 3 deletions

View File

@ -650,9 +650,7 @@ class CSV extends Importer {
foreach ( $exploded_values as $key => $value) { foreach ( $exploded_values as $key => $value) {
$value = trim($value); $value = trim($value);
$exists = term_exists( $value ,$taxonomy->get_db_identifier(), $parent ); $exists = term_exists( $value ,$taxonomy->get_db_identifier(), $parent );
if( 0 !== $exists && null !== $exists && isset($exists['term_id']) ){ if ((0 !== $exists && null !== $exists && isset($exists['term_id'])) || ($value=='') ) {
//$exists = new Entities\Term($exists['term_id']);
//$parent = $exists->get_id();
$parent = $value; $parent = $value;
} else { } else {
$term = new Entities\Term(); $term = new Entities\Term();