Created
May 22, 2012 17:53
-
-
Save thefuxia/2770576 to your computer and use it in GitHub Desktop.
T5 Debug 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 # -*- coding: utf-8 -*- | |
/** | |
* Plugin Name: T5 Debug Hook | |
* Description: Adds a list of registered filters and action for a hook. Call a page with <code>?hook=NAME</code> to see it. | |
*/ | |
add_action( 'shutdown', 't5_debug_hook' ); | |
function t5_debug_hook() | |
{ | |
if ( ! isset ( $_GET['hook'] ) or ! current_user_can( 'update_core') ) | |
{ | |
return; | |
} | |
$f = $GLOBALS['wp_filter']; | |
if ( ! isset ( $f[ $_GET['hook'] ] ) ) | |
{ | |
print 'Nothing found for ' . esc_html( $_GET['hook'] ); | |
return; | |
} | |
print '<pre>' . esc_html( var_export( $f[ $_GET['hook'] ], TRUE ) ) . '</pre>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Howdy, I'm getting a Fatal error: Nesting level too deep - recursive dependency?