fix: teste if props of terms isset

This commit is contained in:
vnmedeiros 2024-04-17 11:44:22 -03:00
parent 5aae4db5ad
commit 9463ee1c36
1 changed files with 3 additions and 1 deletions

View File

@ -137,7 +137,7 @@ class Terms extends Repository {
if ( $mapped['map'] != 'termmeta' ) {
$get_ = 'get_' . $prop;
if ( $term->WP_Term->{$mapped['map']} ||
if ( isset($term->WP_Term->{$mapped['map']}) ||
($mapped['map'] == 'parent' && $term->WP_Term->{$mapped['map']} >= 0) ) {
$args[ $mapped['map'] ] = $term->$get_();
@ -247,6 +247,8 @@ class Terms extends Repository {
}
public function update( $object, $args = null ) {
error_log( "update:" . json_encode($object) );
error_log( "update-des:" . json_encode($object->get_description()) );
return $this->insert( $object );
}