How to get URL parameters?
-
Hi
I want to create a plugin which will add a custom page to any theme. My idea is to use template_redirect. But how will I know when to apply it?
I could use explode(‘&’, $SERVER[‘REQUEST_URI’]), BUT that would not work with all URI patterns. For example it would break if the user opted to use a URI pattern which looks like this: name/value/name/value. Instead of name=value&name=value.
I also need to be able to create links which works well with the URI pattern that the user has opted for. I want to have a template tag which will link to my website. [linktomypluginpage]. If the URI pattern is /name/value/ it should link to mysite.com/plugin/page but if the pattern is name=value, it should link to mysite.com?name=value.
How can I do this?
- The topic ‘How to get URL parameters?’ is closed to new replies.