How to extend a module hook from another module? I want to be able to clone/replicate a node from one language to another on click of a button using a custom module. Basically we have a view which displays all nodes in the system and under the "operations" column, we have Edit, Delete, Clone.

On click of the Clone button, I want to replicate the node (keeping the same exact data values as is except for the language field) to other languages.

I have installed the node_clone and replicate modules to help me, but I am struggling to see how I can create a custom module that can call the hooks in those contrib modules in such a way that I can save the node in different languages automatically instead of click on the "Translate" tab and manually doing it one by one. 

I have tried calling the clone_node_save from the Node clone module from my custom module, but that does not work. 

How can I extend a module hook in a custom module?
You can use the following code to solve your problem: 

//clone the node
$new = clone $node;
//set the node to new
$new-&gt;is_new = true;
//unset the nid and the vid
unset($new-&gt;nid);
unset($new-&gt;vid);
//setting the new language
$new-&gt;language = 'fr';
//save the new node
node_save($new);


Reference: Programmatically create a new node from an existing NID