How do I execute a function every time a node is being updated? I tried to use hook_nodeapi, but it looks like that the hook is removed from Drupal 7.
What I want to do is,
to do this, I need to make sure that there is always only one node with 'main image' set to true.
The hook has not been removed but splitted up into separate hooks for each $op.
See: http://api.drupal.org/api/search/7/hook_node
For post-save, you want hook_node_insert() and hook_node_update()
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