Getting querystring parameter value in wordpress

get_query_var('adminoption') only works with standard or registered vars. So for non-standard Wordpress vars you would need to register it first in your functions.php file:

function rj_add_query_vars_filter( $vars ){
    $vars[] = "adminoption";
    return $vars;
}
add_filter( 'query_vars', 'rj_add_query_vars_filter' );

get_query_var('adminoption');

Realize the question is old but hope it helps anyone.


To get a vars from the query string you can use PHP's $_GET['key'] method.

Depending on what you are doing, you can also use get_query_var('key'), this function works with parameters accepted by the WP_Query class (cat, author, etc).

If you want to use custom query vars with this function, you need to use the query_vars filter to modify the list of supported query vars, you can read how to do that in the documentation linked above.


Raising hidden answer in the comments by David Carrus:

Anyway you may try with the old php $_GET['adminoption'].


I think you are asking for get_query_var() function. In your case you should use get_query_var('adminoption'). Hope it helps