Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

dannymh on "Using $_GET variables as a shortcode attribute"

$
0
0

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

http://mysite/comps/

under that would be a whole lot of links like

comp1
comp2

comp1 would link to http://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


Viewing all articles
Browse latest Browse all 8245

Trending Articles