I'm trying to create a module which creates a redirect when a node is unpublished and removes it if the node is published again.
The redirect module API, has functions for doing both
However I can't work out how to load all the redirects for a specific node in order to delete them, I think you might be able to use
redirect_load_by_source but I can't work out how to get it to function correctly.
Has anyone tackled this sort of problem before?