Skip to content

Instantly share code, notes, and snippets.

@willybahuaud
Last active January 6, 2022 23:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willybahuaud/4613f47337ddbd7410f4821174f1b7f2 to your computer and use it in GitHub Desktop.
Save willybahuaud/4613f47337ddbd7410f4821174f1b7f2 to your computer and use it in GitHub Desktop.
debug hooks and filters
<?php
function trace_hooks() {
global $wp_filter;
foreach ( $wp_filter[current_filter()]->callbacks as $f ) {
var_dump( current_filter(), $f );
}
}
add_action( 'all', 'trace_hooks' );
// code part I want to trace…
remove_action( 'all', 'trace_hooks' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment