function hook_node_prepare

hook_node_prepare($node)

Act on a node object about to be shown on the add/edit form.

This hook is invoked from node_object_prepare() after the type-specific hook_prepare() is invoked.

Parameters

$node: The node that is about to be shown on the add/edit form.

Related topics

File

modules/node/node.api.php, line 645
Hooks provided by the Node module.

Code

function hook_node_prepare($node) {
  if (!isset($node->comment)) {
    $node->comment = variable_get("comment_$node->type", COMMENT_NODE_OPEN);
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!node!node.api.php/function/hook_node_prepare/7.x