Posted By

nerdfiles on 05/29/11


Tagged

wordpress wp hooks listhookedfunctions


Versions (?)

list_hooked_functions


 / Published in: PHP
 

URL: http://www.smashingmagazine.com/2009/08/18/10-useful-wordpress-hook-hacks/

  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  

You need to login to post a comment.