How do I get fields of a certain field type?
I came across this the other day and remembered seeing this question, so here it is, a somehow very unknown function (I have neveer seen anyone mention it in a blog or anything):

field_read_fields()

and the companion function:

field_read_instances()

For example, get all taxonomy term fields:

$taxonomy_fields = field_read_fields(array('type' =&gt; 'taxonomy_term_reference'));


Or get the instances for a field with the a machine name of field_image:

$image_field_instances = field_read_instances(array('field_name' =&gt; 'field_image'));