Skip to content

Instantly share code, notes, and snippets.

@mjangda
Created August 10, 2011 18:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save mjangda/1137703 to your computer and use it in GitHub Desktop.
Save mjangda/1137703 to your computer and use it in GitHub Desktop.
Get all the functions registered to a specific WordPress hook
<?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