You are here

function linkchecker_node_update in Link checker 7

Implements hook_node_update().

File

./linkchecker.module, line 940
This module periodically check links in given node types, blocks etc.

Code

function linkchecker_node_update($node) {

  // Every moderation module saving a forward revision needs to exit here.
  // Please see _linkchecker_isdefaultrevision() for more details.
  // @todo: Refactor this workaround under D8.
  if (!_linkchecker_isdefaultrevision($node)) {
    return;
  }

  // The node is going to be published.
  if (variable_get('linkchecker_scan_node_' . $node->type, FALSE) && $node->status == NODE_PUBLISHED) {
    _linkchecker_add_node_links($node);
  }
  else {

    // The node is going to be unpublished.
    linkchecker_node_delete($node);
  }
}