function hook_clone_node_alter in Node clone 7
Same name and namespace in other branches
- 8 node_clone.api.php \hook_clone_node_alter()
- 6 clone.api.php \hook_clone_node_alter()
Alter the node before saving a clone.
Parameters
$node: Reference to the fully loaded node object being saved (the clone) that can be altered as needed.
array $context: An array of context describing the clone operation. The keys are:
- 'method' : Can be either 'prepopulate' or 'save-edit'.
- 'original_node' : The original fully loaded node object being cloned.
See also
3 invocations of hook_clone_node_alter()
- clone_action_clone in ./clone.module 
- Action callback.
- clone_node_prepopulate in ./clone.pages.inc 
- Clones a node - prepopulate a node editing form
- clone_node_save in ./clone.pages.inc 
- Clones a node by directly saving it.
File
- ./clone.api.php, line 22 
- API documentation for the Node clone module.
Code
function hook_clone_node_alter(&$node, $context) {
  if ($context['original_node']->type == 'special') {
    $node->special = special_something();
  }
}