How to use a custom hook
The problem is the order of execution. The order things run matters. For your code to function, it would require either add_action to implement time travel several microseconds into the past so that it can add the hook before it ran, or it would require do_action to implement precognition so that it knows about add_action … Read more