Created
September 4, 2017 14:26
-
-
Save SalvadorP/9ddc74620cdb281b8607851ff059d49f to your computer and use it in GitHub Desktop.
Quick snippet which shows how to call a callback function after a node has been updated and persisted to the database.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Same for hook_node_save! | |
function my_module_node_update($node) { | |
if ($node->type == 'content_type_name') { | |
// Invoke your callback function AFTER the node is updated. | |
drupal_register_shutdown_function('_my_module_the_function_to_call', $node); | |
} | |
} | |
function _my_module_the_function_to_call($node) { | |
// do stuff... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment