Last active
November 29, 2015 08:01
-
-
Save digamber89/4b1aa7ae253a8e8ab135 to your computer and use it in GitHub Desktop.
Show Filters Attached to Hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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