OOP and WordPress shortcode
That is not the way you add an object method as a callback. function make_shortcode() { add_shortcode(‘ShowMsg’, array($this,’ShowMsg’)); } This is explained in the Codex as it pertains to actions and filters, but the principle is the same. I should add that anonymous classes make for painful debugging. Instantiate that class to a variable. It … Read more