src/Forms/Fields/Types/ChoiceType.php
protected function saveTermSingleValue($value, int $term_id)
    {
        $previous = get_term_meta($term_id, $this->getName(), true);

        if (is_null($value) || empty($value)) {
            delete_term_meta($term_id, $this->getName());
        } elseif (empty($previous)) {
            add_term_meta($term_id, $this->getName(), $value, true);
        } else {
            update_term_meta($term_id, $this->getName(), $value, $previous);
        }
    }
protected function saveTermSingleValue($value, int $term_id)
    {
        $previous = get_term_meta($term_id, $this->getName(), true);

        if (is_null($value) || empty($value)) {
            delete_term_meta($term_id, $this->getName());
        } elseif (empty($previous)) {
            add_term_meta($term_id, $this->getName(), $value, true);
        } else {
            update_term_meta($term_id, $this->getName(), $value, $previous);
        }
    }
protected function saveTermSingleValue ( $ value , int $ term_id ) { $ previous = get_term_meta ( $ term_id , $ this -> getName ( ) , true ) ; if ( is_null ( $ value ) || empty ( $ value ) ) { delete_term_meta ( $ term_id , $ this -> getName ( ) ) ; } elseif ( empty ( $ previous ) ) { add_term_meta ( $ term_id , $ this -> getName ( ) , $ value , true ) ; } else { update_term_meta ( $ term_id , $ this -> getName ( ) , $ value , $ previous ) ; } }
Handle field single term meta registration.

@param string $value
@param int    $term_id
Handle field single term meta registration .