First, you’re using $value
whenever you update the field, so it will always be 8 from the code you have here. Second, you say that you have a custom taxonomy and you’ve put the field on the taxonomy, but you’re not using a $post_id
that is for a custom taxonomy. Overall, the explanation of what you’re doing isn’t very clear. Can you give more information about what you’re trying to do?