You are here

function hook_feeds_node_processor_targets_alter in Feeds 6

Alter mapping targets for nodes. Use this hook to add additional target options to the mapping form of Node processors.

If the key in $targets[] does not correspond to the actual key on the node object ($node->key), real_target MUST be specified. See mappers/link.inc

For an example implementation, see mappers/content.inc

Parameters

&$targets: Array containing the targets to be offered to the user. Add to this array to expose additional options. Remove from this array to suppress options. Remove with caution.

$content_type: The content type of the target node.

Related topics

11 functions implement hook_feeds_node_processor_targets_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

content_feeds_node_processor_targets_alter in mappers/content.inc
Implementation of hook_feeds_node_processor_targets_alter().
content_taxonomy_feeds_node_processor_targets_alter in mappers/content_taxonomy.inc
Implementation of hook_feeds_node_processor_targets_alter().
date_feeds_node_processor_targets_alter in mappers/date.inc
Implementation of hook_feeds_node_processor_targets_alter().
email_feeds_node_processor_targets_alter in mappers/email.inc
Implementation of hook_feeds_node_processor_targets_alter().
emfield_feeds_node_processor_targets_alter in mappers/emfield.inc
Implementation of hook_feeds_node_processor_targets_alter().

... See full list

1 invocation of hook_feeds_node_processor_targets_alter()
FeedsNodeProcessor::getMappingTargets in plugins/FeedsNodeProcessor.inc
Return available mapping targets.

File

./feeds.api.php, line 207
Documentation of Feeds hooks.

Code

function hook_feeds_node_processor_targets_alter(&$targets, $content_type) {
  $targets['my_node_field'] = array(
    'name' => t('My custom node field'),
    'description' => t('Description of what my custom node field does.'),
    'callback' => 'my_callback',
  );
  $targets['my_node_field2'] = array(
    'name' => t('My Second custom node field'),
    'description' => t('Description of what my second custom node field does.'),
    'callback' => 'my_callback2',
    'real_target' => 'my_node_field_two',
  );
}