Shortcode Inside Class Not Working
if you use any hooks, filters or shortcodes with class methods, you have three options. either declare it in the context of an instance, in which case, you can refer to the instance of the class. class myClass { function __construct() { add_shortcode(‘my_shortcode_name’, [ $this, ‘shortcode’ ]); } function shortcode() { //your code here //properties … Read more