You are here

function field_collection_field_load in Field collection 7

Implements hook_field_load().

Invokes the load hooks for the fields contained in new, unsaved field collection items. This allows images inside a field collection item to be seen on a node's preview page before it's saved.

File

./field_collection.module, line 738
Module implementing field collection field type.

Code

function field_collection_field_load($entity_type, $entities, $field, $instances, $langcode, &$items, $age) {
  foreach ($items as &$each_item) {
    foreach ($each_item as &$each_field_collection_item) {
      if (!empty($each_field_collection_item['entity'])) {
        _field_invoke_multiple('load', 'field_collection_item', array(
          NULL => &$each_field_collection_item['entity'],
        ));
      }
    }
  }
}