-1

$this is used internally in a class to point towards internal methods or properties with $this->method();

However in WordPress code, I noticed:

class ABC{
function efg(){
   do_action('hookname', $this);
 }
}

What is $this on its own supposed to mean?

1 Answers1

1

$this refers to the current instance of the class ABC (an object -- efg() isn't a static method that would be run outside the context of a $this existing).

brensnap
  • 129
  • 2