You are here

function youtube_feeds_processor_targets_alter in YouTube Field 7

Implements hook_feeds_processor_targets_alter().

Adds a target option for YouTube fields to Feeds mapping options.

File

./youtube.inc, line 268
YouTube field helper functions.

Code

function youtube_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 (in_array($info['type'], array(
      'youtube',
    ))) {
      $targets[$name] = array(
        'name' => check_plain($instance['label']),
        'callback' => 'youtube_set_target',
        'description' => t('The @label field of the node.', array(
          '@label' => $instance['label'],
        )),
      );
    }
  }
}