You are here

function field_feeds_processor_targets_alter in Feeds 7

Implements hook_feeds_processor_targets_alter().

See also

FeedsNodeProcessor::getMappingTargets().

File

mappers/field.inc, line 17
On behalf implementation of Feeds mapping API for field.module.

Code

function field_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);
    $allowed_types = array(
      'number_integer',
      'number_decimal',
      'number_float',
      'text',
      'text_long',
      'text_with_summary',
    );
    if (in_array($info['type'], $allowed_types)) {
      $targets[$name] = array(
        'name' => $instance['label'],
        'callback' => 'field_feeds_set_target',
        'description' => t('The @label field of the node.', array(
          '@label' => $instance['label'],
        )),
      );
    }
  }
}