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

I’ve recently started using the Hikari Hooks plugin for WordPress as it seems to allow you to get a good idea of what do_actions are being called on the page, so that you can easily find out where potential hooks for plugin code might lie.

Are there better tools/plugins for accomplishing the same thing?

Read More

In particular I was looking for one that might notify me of post status transition actions such as new_to_publish and draft_to_publish…It appears that Hikari Hooks does notify you of such changes but not that they are available, only if you’re already added them as an action.

Related posts

Leave a Reply

3 comments

  1. 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.