You are here

function hook_clone_node_alter in Node clone 8

Same name and namespace in other branches
  1. 6 clone.api.php \hook_clone_node_alter()
  2. 7 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

node_clone_node_save()

drupal_alter()

File

./node_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();
  }
}