function book_node_insert

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

Implements hook_node_insert().

File

modules/book/book.module, line 937

Code

function book_node_insert($node) {
    if (!empty($node->book['bid'])) {
        if ($node->book['bid'] == 'new') {
            // New nodes that are their own book.
            $node->book['bid'] = $node->nid;
        }
        $node->book['nid'] = $node->nid;
        $node->book['menu_name'] = book_menu_name($node->book['bid']);
        _book_update_outline($node);
    }
}

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