Skip to content

Instantly share code, notes, and snippets.

@SalvadorP
Created September 4, 2017 14:26
Show Gist options
  • Save SalvadorP/9ddc74620cdb281b8607851ff059d49f to your computer and use it in GitHub Desktop.
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.
<?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