Skip to content

Instantly share code, notes, and snippets.

@digamber89
Last active November 29, 2015 08:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digamber89/4b1aa7ae253a8e8ab135 to your computer and use it in GitHub Desktop.
Save digamber89/4b1aa7ae253a8e8ab135 to your computer and use it in GitHub Desktop.
Show Filters Attached to Hook
<?php
/* Attaching to Init because plugin files and theme files all have been loaded by this point and no output has been generated */
/* using anonymous function */
add_action('init', function(){
/* replace wp_head with any filter or action hook */
$hooks = digthis_see_hooked_actions('wp_head');
var_dump($hooks);
});
function digthis_see_hooked_actions($hook = NULL){
if(isset($hook)){
global $wp_filter;
return $wp_filter[$hook] ;
}
return false;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment