Sometimes wordpress developers need to pass values through PHP’s GET method. For example, you need to pass your name to another page by GET method like
http://yoursite.com/some-page/?myname=john&age=23
Now you need to retrieve myname and age variables, but wordpress is designed to ignore such things in URL. You get surprised when you don’t seen anything with
<?php print_r($_GET); ?>
Hence, i decided to make a simple plugin that does this functionality. Qstring is a plugin to allow to access get parameters from query string or URL easily.
Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
== Frequently Asked Questions ==
Usage Examples
<?php
// IMPORT GET PARAMETERS IN ARRAY FORMAT
$myvar = load_qstrings();
// USING PARAMETER WHEREVER NEEDED
echo $myvar['user_id'];
// TO DEBUG, USE PRINT_R
print_r($myvar);
?>
Limitations
There are some reserved keywords in wordpress like “name”. These should not be used otherwise wordpress shows “The page you requested could not be found.” OR something similar depending on your theme.