node_access_example_node_insert

Versions
7
node_access_example_node_insert($node)

Implementation of hook_node_insert().

The module must track the access status of the node.

Code

developer/examples/node_access_example.module, line 143

<?php
function node_access_example_node_insert($node) {
  if (isset($node->private)) {
    db_insert('node_access_example')->fields(array('nid' => $node->nid, 'private' => (int)$node->private))->execute();
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.