diff --git a/src/classes/entities/class-tainacan-term.php b/src/classes/entities/class-tainacan-term.php index 4e5a86dc7..9c0af5a39 100644 --- a/src/classes/entities/class-tainacan-term.php +++ b/src/classes/entities/class-tainacan-term.php @@ -45,6 +45,19 @@ class Term extends Entity { return 'Hello, my name is '. $this->get_name(); } + public function __toArray(){ + $term_array = parent::__toArray(); + + $term_id = $term_array['term_id']; + + unset($term_array['term_id']); + unset($term_array['status']); + + $term_array['id'] = $term_id; + + return $term_array; + } + // Getters /** diff --git a/src/classes/field-types/category/AddNewTerm.vue b/src/classes/field-types/category/AddNewTerm.vue index 057053854..9a6b34e54 100644 --- a/src/classes/field-types/category/AddNewTerm.vue +++ b/src/classes/field-types/category/AddNewTerm.vue @@ -28,7 +28,7 @@