You are here

function metatags_quick_feeds_set_target in Meta tags quick 7.2

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

Callback for mapping metatag fields

Implementation of hook_feeds_set_target().

Parameters

$source: A FeedsSource object.

$entity: The entity to map to.

$target: The target key on $entity to map to.

$value: The value to map. Can be an array or a string.

1 string reference to 'metatags_quick_feeds_set_target'
metatags_quick_feeds_processor_targets_alter in ./metatags_quick.feeds.inc
Implements hook_feeds_processor_targets_alter() for metatags_quick fields.

File

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

Code

function metatags_quick_feeds_set_target($source, $entity, $target, $value) {
  if (empty($value)) {
    return;
  }
  if (strstr($target, 'meta')) {
    $field['und'][0]['meta_name'] = substr($target, 11);

    /* strip off field_meta_ */
    $field['und'][0]['metatags_quick'] = $value;
  }
  $entity->{$target} = $field;
}