Community Documentation

hook_load

5 node.php hook_load($node)
6 node.php hook_load($node)
7 node.api.php hook_load($nodes)
8 node.api.php hook_load($nodes)

Load node-type-specific information.

This is a hook used by node modules. It is called to allow the module a chance to load extra information that it stores about a node, or possibly replace already loaded information - which can be dangerous.

Parameters

$node: The node being loaded. At call time, node.module has already loaded the basic information about the node, such as its node ID (nid), title, and body.

Return value

An object containing properties of the node being loaded. This will be merged with the passed-in $node to result in an object containing a set of properties resulting from adding the extra properties to the passed-in ones, and overwriting the passed-in ones with the extra properties if they have the same name as passed-in properties.

For a detailed usage example, see node_example.module.

Related topics

▾ 21 functions implement hook_load()

book_load in modules/book.module
Implementation of hook_load().
drupal_load in includes/bootstrap.inc
Includes a file with the provided type and name. This prevents including a theme, engine, module, etc., more than once.
fileupload_file_download in developer/examples/fileupload.module
Implementation of hook_file_download.
fileupload_load in developer/examples/fileupload.module
Implementation of hook_load().
file_check_upload in includes/file.inc
file_download in includes/file.inc
file_save_upload in includes/file.inc
Saves a file upload to a new location. The source file is validated as a proper upload and handled as such.
forum_load in modules/forum.module
Implementation of hook_load().
hook_file_download in developer/hooks/core.php
Allow file downloads.
multipage_form_example_load in developer/examples/multipage_form_example.module
Implementation of hook_load().
node_example_load in developer/examples/node_example.module
Implementation of hook_load().
node_load in modules/node.module
Load a node object from the database.
path_load in modules/path.module
Fetch a specific URL alias from the database.
poll_load in modules/poll.module
Implementation of hook_load().
upload_download in modules/upload.module
upload_file_download in modules/upload.module
upload_load in modules/upload.module
user_external_load in modules/user.module
user_file_download in modules/user.module
Implementation of hook_file_download().
user_load in modules/user.module
Fetch a user object.
_comment_load in modules/comment.module
Load the entire comment by cid.

File

developer/hooks/node.php, line 257
These hooks are defined by node modules, modules that define a new kind of node.

Code

<?php
function hook_load($node) {
  $additions = db_fetch_object(db_query('SELECT * FROM {mytable} WHERE vid = %d', $node->vid));
  return $additions;
}
?>
Login or register to post comments