List hooked functions in Wordpress


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function list_hooked_functions($tag=false){
  2. global $wp_filter;
  3. if ($tag) {
  4. $hook[$tag]=$wp_filter[$tag];
  5. if (!is_array($hook[$tag])) {
  6. trigger_error("Nothing found for '$tag' hook", E_USER_WARNING);
  7. return;
  8. }
  9. }
  10. else {
  11. $hook=$wp_filter;
  12. ksort($hook);
  13. }
  14. echo '<pre>';
  15. foreach($hook as $tag => $priority){
  16. echo "<br />&gt;&gt;&gt;&gt;&gt;\t<strong>$tag</strong><br />";
  17. ksort($priority);
  18. foreach($priority as $priority => $function){
  19. echo $priority;
  20. foreach($function as $name => $properties) echo "\t$name<br />";
  21. }
  22. }
  23. echo '</pre>';
  24. return;
  25. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.