You are here

function metatags_quick_feeds_get_source in Meta tags quick 7.2

Same name and namespace in other branches
  1. 8.3 metatags_quick.feeds.inc \metatags_quick_feeds_get_source()

Callback for mapping parent metatags to child metatag values.

Parameters

$source: A FeedsSource object.

$result: FeedsParserResult object.

$key: The key as defined in the _feeds_parser_sources_alter() hook defined above.

Return value

array The metatag value.

1 string reference to 'metatags_quick_feeds_get_source'
metatags_quick_feeds_parser_sources_alter in ./metatags_quick.feeds.inc
Implements hook_feeds_parser_sources_alter().

File

./metatags_quick.feeds.inc, line 39
Code is effectively a port of the Feeds code from the References module.

Code

function metatags_quick_feeds_get_source(FeedsSource $source, FeedsParserResult $result, $key) {
  if ($node = node_load($source->feed_nid)) {
    $results = array();
    $field = substr($key, 23);
    if (!empty($node->{$field}['und'])) {
      foreach ($node->{$field}['und'] as $delta => $value) {
        $results[] = $value['metatags_quick'];
      }
    }
    return $results;
  }
}