I've written a shortcode plugin. Basically the plugin has the following structure:
PL::setup();
class PL {
public static function setup() {
add_shortcode("myshortcode", array ( __CLASS__,"myshortcode_handler"));
}
public static function myshortcode_handler(
... some variable assignment?
if (time the shortcode is invoked == 1) {
...
}
else {
...
}
... some other code lines
}
}
I need to distinguish the case the shortcode is invoked for the first time or not. I think I have to declare some variable, but I do not know how and where I have to declare it.