Using $_GET variables as a shortcode attribute
-
Hi,
I am writing a plugin and considering using shortcodes to accomplish this, information is going to be passed from page to page. In doing so a variable is going to be passed and I want to take that variable and use it for the shortcode.
So the first page would be
under that would be a whole lot of links like
comp1
comp2comp1 would link to https://mysite/comps/comp/1
etc
I want to then grab the variable of comp=1 and pass that to the shortcode so the shortcode would take you to the comp page and the rewrite_endpoint(‘comp’, …)
would pick up that the rest are variables and values. And I can have a short code of something like
[myshortcode_comp comp=$_GET[“comp”]]
Not sure exactly whether this is possible but if it is can anyone possibly help out here?
Cheers
Dan
- The topic ‘Using $_GET variables as a shortcode attribute’ is closed to new replies.