[wp-hackers] Class function in Hook
SoJ Web
sojweb at indiana.edu
Sat Aug 15 23:39:48 UTC 2009
Right on. More info here:
http://us2.php.net/manual/en/language.pseudo-types.php#language.types.callback
-Jeff
On Aug 15, 2009, at 7:35 PM, Austin Matzko wrote:
> On Sat, Aug 15, 2009 at 6:23 PM, John Kolbert<list at johnkolbert.com>
> wrote:
>> This question may just show a lack of PHP knowledge, but I was
>> wondering
>> what the difference between these two were:
>>
>> // First
>> $bf_vendor = new bf_vendor();
>>
>> register_activation_hook(__FILE__, array(&$bf_vendor,
>> 'installTable'));
>>
>> // Second
>>
>> register_activation_hook(__FILE__, array('bf_vendor',
>> 'installTable'));
>
> The second makes installTable a static method of bf_vendor, so it will
> work as long as installTable can be a static method (which it can't,
> e.g., if it references $this).
> _______________________________________________
> 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