You are here

function taxonomy_feeds_parser_sources_alter in Feeds 6

Same name and namespace in other branches
  1. 8.2 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()

Implementation of hook_feeds_parser_sources_alter().

File

mappers/taxonomy.inc, line 11
Mapper that exposes a node's taxonomy vocabularies as mapping targets.

Code

function taxonomy_feeds_parser_sources_alter(&$sources, $content_type) {
  if (!empty($content_type)) {
    foreach (taxonomy_get_vocabularies($content_type) as $vocabulary) {
      $sources['parent:taxonomy:' . taxonomy_vocabulary_id($vocabulary)] = array(
        'name' => t('Feed node: Taxonomy: @vocabulary', array(
          '@vocabulary' => $vocabulary->name,
        )),
        'description' => t('Taxonomy terms from feed node in given vocabulary.'),
        'callback' => 'taxonomy_feeds_get_source',
      );
    }
  }
}