function node_load in Drupal 7
Same name and namespace in other branches
- 8 core/modules/node/node.module \node_load()
- 4 modules/node.module \node_load()
- 5 modules/node/node.module \node_load()
- 6 modules/node/node.module \node_load()
Loads a node object from the database.
Parameters
$nid: The node ID.
$vid: The revision ID.
$reset: Whether to reset the node_load_multiple cache.
Return value
A fully-populated node object, or FALSE if the node is not found.
88 calls to node_load()
- BookTestCase::testBookDelete in modules/
book/ book.test - Tests the access for deleting top-level book nodes.
- book_admin_edit_submit in modules/
book/ book.admin.inc - Form submission handler for book_admin_edit().
- book_block_view in modules/
book/ book.module - Implements hook_block_view().
- book_export in modules/
book/ book.pages.inc - Menu callback; Generates representations of a book page and its children.
- book_export_html in modules/
book/ book.pages.inc - Generates HTML for export when invoked by book_export().
File
- modules/
node/ node.module, line 963 - The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.
Code
function node_load($nid = NULL, $vid = NULL, $reset = FALSE) {
$nids = isset($nid) ? array(
$nid,
) : array();
$conditions = isset($vid) ? array(
'vid' => $vid,
) : array();
$node = node_load_multiple($nids, $conditions, $reset);
return $node ? reset($node) : FALSE;
}