In Drupal 7, I want to add a additional process when a node gets Published. How can I get triggered when that node's "Publish" event fires?
Is there any hook for node "Publish"?
With core functionality, there is no hook. But Revisioning module provides one.
You can however workaround by checking node's status on update OP. Not very smart though.
<?php
function MYMODULE_node_update($node){
if (isset($node->original->status) && $node->original->status == 0 && $node->status == 1){
MYMODULE_mymagic_func($node);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With