Is there a way to know what functions are hooked to a particular hook? For example if I’d like to know what functions are hooked to the wp_head
hook.
Leave a Reply
You must be logged in to post a comment.
Is there a way to know what functions are hooked to a particular hook? For example if I’d like to know what functions are hooked to the wp_head
hook.
You must be logged in to post a comment.
Look into the global variable
$wp_filter
. See my plugin for a list of all comment filters for an example:Sample output for
pre_comment_author_email
:to see list of functions or actions hooked to a particular action hook you can use the following code.
For debug-purposes a simple
would do it …
This shows a more readable list of filters
I found the answer from @Simone G useful, but it didn’t take into account the fact, that sometimes Closures can be hooked. Here’s my more verbose (and ugly) version: