if ( isset( $term ) && isset( $term->{$id_field} ) ) {
                // Term does exist after checking the matching value. we want its id.
                $term_id = $term->{$id_field};

                if ( true === $check_only ) {