Retrieve all image_field fields of the same content type (bundle)
Parameters
string $entity_type:
string $bundle_name:
Return value
array
1 call to _exif_field_widget_retrieve_image_field_from_bundle()
- exif_field_widget_settings_form in ./
exif.module - Implements hook_widget_settings().
File
-
./
exif.module, line 765
Code
function _exif_field_widget_retrieve_image_field_from_bundle($entity_type, $bundle_name) {
$fields_of_bundle = field_info_instances($entity_type, $bundle_name);
$result = array();
foreach ($fields_of_bundle as $key => $value) {
if (is_array($value) && is_array($value['widget']) && ($value['widget']['type'] == 'image_image' || $value['widget']['type'] == 'media_generic' || $value['widget']['type'] == 'image_miw')) {
$result[$key] = $value['label'] . " (" . $key . ")";
}
}
return $result;
}