I’m a newbie at PHP and WordPress, so please be gentle!
I’m building a plugin – following a few tutorials, getting it all working.
My question is why is the function I want to call wrapped up in the array($this, function)
? For example I have this constructor code inside my class
function __construct() {
add_action( 'admin_init',array( $this, 'getStuffDone' ) );
}
The getStuffDone function gets fired OK – but why does it have to be in the format it is in?
Any insight is much appreciated.