Add custom field to taxonomy terms I am writing a module that creates a vocabulary through code. Here's what I use:

$new_vocab_name = 'my_categories';
$vocab_obj = (object) array(
   'name' =&gt; t('My Categories'),
   'machine_name' =&gt; $new_vocab_name,
);
taxonomy_vocabulary_save($vocab_obj);


How do I add custom fields for terms that will be in this vocabulary? E.g., I want to add an image field for each term.
I think this article will be usefull for You because taxonomy is one of entity types:
Working programmatically with fields in Drupal 7

So You should set "entity_types" as taxonomy.