function forum_node_insert

Same name in other branches
  1. 9 core/modules/forum/forum.module \forum_node_insert()
  2. 8.9.x core/modules/forum/forum.module \forum_node_insert()
  3. 10 core/modules/forum/forum.module \forum_node_insert()
  4. 11.x core/modules/forum/forum.module \forum_node_insert()

Implements hook_node_insert().

File

modules/forum/forum.module, line 397

Code

function forum_node_insert($node) {
    if (_forum_node_check_node_type($node)) {
        if (!empty($node->forum_tid)) {
            $nid = db_insert('forum')->fields(array(
                'tid' => $node->forum_tid,
                'vid' => $node->vid,
                'nid' => $node->nid,
            ))
                ->execute();
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.