Created
August 10, 2011 18:26
-
-
Save mjangda/1137703 to your computer and use it in GitHub Desktop.
Get all the functions registered to a specific WordPress 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 | |
function debug_get_functions_for_hook( $hook ) { | |
global $wp_filter; | |
if( ! isset( $wp_filter[$hook] ) ) | |
return; | |
$functions = array(); | |
foreach( (array) $wp_filter[$hook] as $key => $actions ) { | |
//$functions = array_merge( $functions, $actions ); | |
$functions['priority_' . $key] = array_keys( $actions ); | |
} | |
ksort( $functions ); | |
return $functions; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment