function file_field_prepare_view

Implements hook_field_prepare_view().

File

modules/file/file.field.inc, line 199

Code

function file_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items) {
    // Remove files specified to not be displayed.
    foreach ($entities as $id => $entity) {
        foreach ($items[$id] as $delta => $item) {
            if (!file_field_displayed($item, $field)) {
                unset($items[$id][$delta]);
            }
        }
        // Ensure consecutive deltas.
        $items[$id] = array_values($items[$id]);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.