Best way to initiate a class in a WP plugin?

Good question, there are a number of approaches and it depends on what you want to achieve. I often do; add_action( ‘plugins_loaded’, array( ‘someClassy’, ‘init’ )); class someClassy { public static function init() { $class = __CLASS__; new $class; } public function __construct() { //construct what you see fit here… } //etc… } A more … Read more