Reads in field instances that match an array of conditions.
$param: An array of properties to use in selecting a field instance. Keys are names of properties found in field instance configuration files, and values are conditions to match.
$include_additional: The default behavior of this function is to not return field instances that have been marked deleted, or whose field is inactive. Setting $include_additional['include_inactive'] or $include_additional['include_deleted'] to TRUE will override this behavior.
An array of instances matching the arguments.
function field_read_instances($conditions = array(), $include_additional = array()) {
// Include instances of inactive fields if specified in the
// $include_additional parameter.
$include_inactive = isset($include_additional['include_inactive']) && $include_additional['include_inactive'];
// Include deleted instances if specified either in the $include_additional
// or the $conditions parameters.
$include_deleted = isset($include_additional['include_deleted']) && $include_additional['include_deleted'] || isset($conditions['deleted']) && $conditions['deleted'];
// Pass include_inactive and include_deleted to the $conditions array.
$conditions['include_inactive'] = $include_inactive;
$conditions['include_deleted'] = $include_deleted;
return entity_load_multiple_by_properties('field_instance', $conditions);
}