[wp-hackers] debugging a wordpress hook

Mike Schinkel mikeschinkel at newclarity.net
Wed Mar 17 13:36:00 UTC 2010


> @mikeschinkel : thank you very much.  i believe your answer has fulfill my question. ;0 . i never look into $_GLOBAL cause when we try to dump it, its array too long ;D now i know where too look for. 

Note that it's $GLOBALS and not $_GLOBAL.

Also, if you really want to figure out what's going on internally download PhpStorm and get the debugger set up.  It works like a charm.

-Mike

On Mar 17, 2010, at 9:19 AM, Uwiuw Bakawan.com wrote:

> @mikeschinkel : thank you very much.  i believe your answer has fulfill my question. ;0 . i never look into $_GLOBAL cause when we try to dump it, its array too long ;D now i know where too look for. 
> 
> @Frank Bueltge :  i believe this is one of plugin i put in my arsenal when doing wp custom work. As you can said, it only work on general. Maybe i'm just lazy too see into the code to utilize it...thank you ;D
> 
> --- On Wed, 17/3/10, Mike Schinkel <mikeschinkel at newclarity.net> wrote:
> 
>> From: Mike Schinkel <mikeschinkel at newclarity.net>
>> Subject: Re: [wp-hackers] debugging a wordpress hook
>> To: wp-hackers at lists.automattic.com
>> Date: Wednesday, 17 March, 2010, 9:07 PM
>> Hi Uwiuw,
>> 
>> On Mar 17, 2010, at 8:49 AM, Uwiuw Bakawan.com wrote:
>>> i'm and my friend have this kind of weird question. Is
>> there any way to hook a debug function into a hook such as
>> 'init' and retrieve every php function's name whose operates
>> on this particular hook ?
>> 
>> 
>> If I understand your question, you don't need a hook you
>> just need this:
>> 
>> <?php 
>> /*
>> Template Name: Hook Dump
>> */
>> header('Content-type:text/plain');
>> var_dump($GLOBALS['wp_filter'][$_GET['hook']]); 
>> ?>
>> 
>> Save this page template, create a page called "debug" that
>> uses it, and then you can check any hook you want via a URL
>> parameter, i.e.:
>> 
>> http://example.com/debug/?hook=init
>> 
>> HTH.
>> 
>> -Mike
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>> 
> 
> 
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list