node_db_rewrite_sql

Versions
4.6 – 6
node_db_rewrite_sql($query, $primary_table, $primary_field)

Implementation of hook_db_rewrite_sql

Related topics

Code

modules/node.module, line 2531

<?php
function node_db_rewrite_sql($query, $primary_table, $primary_field) {
  if ($primary_field == 'nid' && !node_access_view_all_nodes()) {
    $return['join'] = _node_access_join_sql($primary_table);
    $return['where'] = _node_access_where_sql();
    $return['distinct'] = 1;
    return $return;
  }
}
?>
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.