Fixes bug when adding a existing term in bulk
This commit is contained in:
parent
362b43cf5c
commit
2b32d2ab51
|
@ -292,14 +292,24 @@ class Terms extends Repository {
|
||||||
} elseif ( $taxonomy instanceof Entities\Taxonomy ) {
|
} elseif ( $taxonomy instanceof Entities\Taxonomy ) {
|
||||||
$taxonomy_slug = $taxonomy->get_db_identifier();
|
$taxonomy_slug = $taxonomy->get_db_identifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
$args = [
|
if(is_numeric($name)){
|
||||||
'name' => $name,
|
$args = [
|
||||||
'taxonomy' => $taxonomy_slug,
|
'id' => (int) $name,
|
||||||
'parent' => $parent,
|
'taxonomy' => $taxonomy_slug,
|
||||||
'hide_empty' => 0,
|
'parent' => $parent,
|
||||||
'suppress_filter' => true
|
'hide_empty' => 0,
|
||||||
];
|
'suppress_filter' => true
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$args = [
|
||||||
|
'name' => $name,
|
||||||
|
'taxonomy' => $taxonomy_slug,
|
||||||
|
'parent' => $parent,
|
||||||
|
'hide_empty' => 0,
|
||||||
|
'suppress_filter' => true
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
if (is_null($parent)) {
|
if (is_null($parent)) {
|
||||||
unset($args['parent']);
|
unset($args['parent']);
|
||||||
|
|
Loading…
Reference in New Issue