You are here

function taxonomy_feeds_parser_sources_alter in Feeds 8.2

Same name and namespace in other branches
  1. 6 mappers/taxonomy.inc \taxonomy_feeds_parser_sources_alter()
  2. 7.2 mappers/taxonomy.inc \taxonomy_feeds_parser_sources_alter()
  3. 7 mappers/taxonomy.inc \taxonomy_feeds_parser_sources_alter()

Implements hook_feeds_parser_sources_alter().

File

mappers/taxonomy.inc, line 31
On behalf implementation of Feeds mapping API for taxonomy.module.

Code

function taxonomy_feeds_parser_sources_alter(&$sources, $content_type) {
  if (!empty($content_type)) {
    foreach (field_info_instances('node', $content_type) as $name => $instance) {
      $info = field_info_field($name);
      if ($info['type'] == 'taxonomy_term_reference') {
        $sources['parent:taxonomy:' . $info
          ->label()] = array(
          'name' => t('Feed node: Taxonomy: @vocabulary', array(
            '@vocabulary' => $instance
              ->label(),
          )),
          'description' => t('Taxonomy terms from feed node.'),
          'callback' => 'taxonomy_feeds_get_source',
        );
      }
    }
  }
}