You are here

function video_embed_field_feeds_processor_targets_alter in Video Embed Field 7.2

Implements hook_feeds_processor_targets_alter().

See also

FeedsNodeProcessor::getMappingTargets()

File

./video_embed_field.feeds.inc, line 12
On behalf implementation of Feeds mapping API for video_embed_field.module.

Code

function video_embed_field_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) {
  foreach (field_info_instances($entity_type, $bundle_name) as $name => $instance) {
    $info = field_info_field($name);
    if ($info['type'] == 'video_embed_field') {
      $targets[$name . ":video_url"] = array(
        'name' => t('@name: Embed URL', array(
          '@name' => $instance['label'],
        )),
        'callback' => 'video_embed_field_set_target',
        'description' => t('The URL for the @label field of the @entity_type.', array(
          '@entity_type' => $entity_type,
          '@label' => $instance['label'],
        )),
        'real_target' => $name,
      );
      $targets[$name . ':description'] = array(
        'name' => t('@name: Embed description', array(
          '@name' => $instance['label'],
        )),
        'callback' => 'video_embed_field_set_target',
        'description' => t('The description for the @label field of the @entity_type.', array(
          '@entity_type' => $entity_type,
          '@label' => $instance['label'],
        )),
        'real_target' => $name,
      );
    }
  }
}