I'm running Drupal 7 and I want to re-save the user account of the node author after deleting a node of content type picture. I want to do this because I have some code called in hook_user_presave()
that counts the number of pictures a user has added and saves it in an integer field in the user.
I looked at hook_node_delete()
and hook_entity_delete()
as suggested in this question, but when then are invoked, the node is not yet deleted, so if I save the user at that point, the int value is one more than it should be (because the deleted file has not actually been deleted yet).
Is there a hook for responding to node deletion after it has taken place?
Related question: Hook for reacting after adding node