@Thomas John, you're right about the second argument in add_action, and nothing is mentioned in wordpress org, so let me know, we can pass the array as the second array of arguments ($ this, 'method').
Description: when an object creates a class, then the constructor automatically calls and your action performs.
WHY REQUIRES wordpress how to create or initialize a class in the add_action method in a short add_action, referring to the class check below the example
class Myclass{ public function __construct() { add_action( 'plugins_loaded', array( $this, 'load_plugin_textdomain' ) ); } }
Link to the class using add_action ().
Hiren kubavat
source share