Hey guys!
I'm working on a plugin that creates HTML Code via a shortcode.
Now I want to identify the created HTML when the shortcode gets called twice or more often.
Like:
<div class="myClass-0"></div>
<div class="myClass-1"></div>
Is there a way to count how many times a specific shortcode got called?
I tried this PHP code:
if(!$count)
{
$count = 0;
}
else
{
$count = $count + 1;
}
But it seems as the variable gets deleted after calling the shortcode one time.
I also tried global variables… But all this didn't seem to work.
Hope somebody can help me!
Greets
J.