wordpress : add_action : why the second parameter is an array instead of a function name

Solution:

Because the second argument needs to be a callback. (and add_action internally uses call_user_func_array).

For functions we can just pass its name as a string but we can’t do that with object methods, can we?

So an array is passed with 2 elements, first the object and second the method to call:-

array( $object, 'method' )

Oh and you can safely remove that useless ‘&’, PHP4 days are gone now.