Skip to content

Instantly share code, notes, and snippets.

@thefuxia
Created May 22, 2012 17:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thefuxia/2770576 to your computer and use it in GitHub Desktop.
Save thefuxia/2770576 to your computer and use it in GitHub Desktop.
T5 Debug Hook
<?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>';
}
@dougcassidy
Copy link

Howdy, I'm getting a Fatal error: Nesting level too deep - recursive dependency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment