WordPress complete list of hooks and hooked functions

In article Using add_filter hook… we set the the code how to enumerate the functions being hooked to the specific WordPress hook, but we never covered how to show all hooks and all the hooking functions, and lastly to show the execution priories for the hooking functions execution.

It must be several years I saw this article.

It contains the code to print all hooked WordPress functions for all hooks.

function list_hooked_functions($tag=false){

 global $wp_filter;

 if ($tag) {

 $hook[$tag]=$wp_filter[$tag];

 if (!is_array($hook[$tag])) {

 trigger_error("Nothing found for '$tag' hook", E_USER_WARNING);

 return;

 }

 }

 else {

 $hook=$wp_filter;

 ksort($hook);

 }

 echo '<pre>';

 foreach($hook as $tag => $priority){

 echo "<br />&gt;&gt;&gt;&gt;&gt;\t<strong>$tag</strong><br />";

 ksort($priority);

 foreach($priority as $priority => $function){

 echo $priority;

 foreach($function as $name => $properties) echo "\t$name<br />";

 }

 }

 echo '</pre>';

 return;

}

list_hooked_functions();

Here is how the list may look like:

>>>>>	the_content

8	000000001d3591230000000096d6f3b0run_shortcode

	000000001d3591230000000096d6f3b0autoembed

10	wptexturize

	convert_smilies

	convert_chars

	wpautop

	shortcode_unautop

	prepend_attachment

11	capital_P_dangit

	do_shortcode



>>>>>	the_content_rss

8	ent2ncr



>>>>>	the_excerpt

10	wptexturize

	convert_smilies

	convert_chars

	wpautop

	shortcode_unautop



>>>>>	the_excerpt_rss

8	ent2ncr

10	convert_chars



>>>>>	the_posts

10	_close_comments_for_old_posts



>>>>>	the_title

10	wptexturize

	convert_chars

	trim

11	capital_P_dangit

Thanks

tags: & category: -