Currently i am using the following generic flow for adding the shortcode for a plugin.
class MyPlugin {
private $myvar;
function baztag_func() {
print $this->myvar;
}
}
add_shortcode( 'baztag', array('MyPlugin', 'baztag_func') );
Now when this class and it's method are called i get the following error.
Fatal error: Using $this when not in object context in ...
(Line no is where i have printed the $this->myvar)
Is this a problem on Wordpress's end or is there is something i'm doing wrong? It seems to be something really simple.
static. – kaiser Sep 27 '12 at 15:21