1 node_access_example.module node_access_example_node_load($nodes, $types)

Implements hook_node_load().

Gather and add the private setting for the nodes Backdrop is loading.

See also

nodeapi_example.module

Related topics

File

modules/examples/node_access_example/node_access_example.module, line 399
Module file illustrating API-based node access.

Code

function node_access_example_node_load($nodes, $types) {
  $result = db_query('SELECT nid, private FROM {node_access_example} WHERE nid IN(:nids)', array(':nids' => array_keys($nodes)));
  foreach ($result as $record) {
    $nodes[$record->nid]->private = $record->private;
  }
}