You are here

function feeds_node_insert in Feeds 7

Same name and namespace in other branches
  1. 8.2 feeds.module \feeds_node_insert()
  2. 7.2 feeds.module \feeds_node_insert()

Implements hook_node_insert().

Related topics

File

./feeds.module, line 391
Feeds - basic API functions and hook implementations.

Code

function feeds_node_insert($node) {
  _feeds_node_processor_node_insert($node);
  feeds_node_update($node);
  if ($importer_id = feeds_get_importer_id($node->type)) {

    // Start import if requested.
    if (feeds_importer($importer_id)->config['import_on_create'] && !isset($node->feeds['suppress_import'])) {
      feeds_batch_set(t('Importing'), 'import', $importer_id, $node->nid);
    }

    // Schedule source and importer.
    feeds_source($importer_id, $node->nid)
      ->schedule();
    feeds_importer($importer_id)
      ->schedule();
  }
}