Created
January 11, 2016 20:42
-
-
Save dcavins/8cff93ad986377cf5e3c to your computer and use it in GitHub Desktop.
See what functions are hooked to a WordPress filter.
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
// Utility filter to see what's attached to a filter: | |
function dc_wp_show_hooked_filters() { | |
// Set the hook name you're checking out here. | |
$hook_name = 'pre_get_posts'; | |
global $wp_filter; | |
echo '<pre class="filter-dump">'; | |
var_dump( $wp_filter[$hook_name] ); | |
echo '</pre>'; | |
} | |
add_action( 'wp_head', 'dc_wp_show_hooked_filters' ); | |
add_action( 'admin_head', 'dc_wp_show_hooked_filters' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment