Good tools for locating hooks in a wordpress page/admin interface/blog post?

It is usually easy to find most hooks in documentation or source. It can be much more tricky for hooks that are dynamically generated, like post transitions. Essentially it doesn’t exist in source as specific hook – it is hook that is getting generated dynamically at runtime, depending on variables.

do_action("${old_status}_to_$new_status", $post);
do_action("${new_status}_$post->post_type", $post->ID, $post);

At local test stack I often just add var_dump() on variables to source code to see what is going on. Dirty, but easy and fast. Obviously highly not recommended for production environment.

Leave a Comment