[wp-hackers] Finding out number of functions hooked to a
wordpress at santosj.name
Sun Dec 9 22:54:35 GMT 2007
James Davis wrote:
> Is there any way to determine how many functions have been hooked to a
> particular function? In particular I'd like to be able to tell if
> causes any function to be called at all.
There is a global variable, called $wp_filter that holds all of the hooks.
So basically, mockup code would be like.
if( isset($wp_filter['foo']) )
$i = 0;
foreach($wp_filter['foo'] as $priority)
$i += count($priority);
http://www.santosj.name - blog
http://wordpress.svn.dragonu.net/unittest/ - unofficial WP unit test suite.
Also known as darkdragon and santosj on WP trac.
More information about the wp-hackers