hook_node_prepare

  1. drupal
    1. 8
    2. 7
Versions
7 – 8 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

Code

modules/node/node.api.php, line 630

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