You are here

function file_feeds_processor_targets_alter in Feeds 7

Same name and namespace in other branches
  1. 8.2 mappers/file.inc \file_feeds_processor_targets_alter()

Implements hook_feeds_processor_targets_alter().

See also

FeedsNodeProcessor::getMappingTargets().

File

mappers/file.inc, line 18
On behalf implementation of Feeds mapping API for file.module and image.module.

Code

function file_feeds_processor_targets_alter(&$targets, $entity_type, $content_type = '') {
  foreach (field_info_instances($entity_type, $content_type) as $name => $instance) {
    $info = field_info_field($name);
    if (in_array($info['type'], array(
      'file',
      'image',
    ))) {
      $targets[$name] = array(
        'name' => $instance['label'],
        'callback' => 'file_feeds_set_target',
        'description' => t('The @label field of the node.', array(
          '@label' => $instance['label'],
        )),
      );
    }
  }
}