You are here

function _media_gallery_field_get_items in Media Gallery 7

Same name and namespace in other branches
  1. 7.2 media_gallery.module \_media_gallery_field_get_items()

media_gallery_media_original is not a field and therefore cannot be used by field_get_items.

1 call to _media_gallery_field_get_items()
media_gallery_get_file_ids in ./media_gallery.module
Returns all file IDs attached to a media gallery node.

File

./media_gallery.module, line 827

Code

function _media_gallery_field_get_items($entity_type, $entity, $field_name, $langcode = NULL) {
  if ($entity_type == 'node' && $field_name == 'media_gallery_media_original') {
    $media = $entity->media_gallery_media;
    $entity->media_gallery_media = $entity->media_gallery_media_original;
    $field_name = 'media_gallery_media';
  }
  $items = field_get_items($entity_type, $entity, $field_name, $langcode);
  if (isset($media)) {
    $entity->media_gallery_media = $media;
  }
  return $items;
}