Last active
January 6, 2022 23:58
-
-
Save willybahuaud/4613f47337ddbd7410f4821174f1b7f2 to your computer and use it in GitHub Desktop.
debug hooks and filters
This file contains hidden or 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 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