Community Documentation

node_object_prepare

5 node.module node_object_prepare(&$node)
6 node.pages.inc node_object_prepare(&$node)
7 node.module node_object_prepare($node)
8 node.module node_object_prepare($node)

File

modules/node/node.module, line 2056
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

<?php
function node_object_prepare(&$node) {
  // Set up default values, if required.
  if (!isset($node->created)) {
    $node->created = time();
  }
  if (!isset($node->date)) {
    $node->date = format_date($node->created, 'custom', 'Y-m-d H:i:s O');
  }

  node_invoke($node, 'prepare');
  node_invoke_nodeapi($node, 'prepare');
}
?>
Login or register to post comments