Getting querystring parameter value in wordpress
query-string, wordpress
Solution
I think you are asking for get_query_var() function. In your case you should use get_query_var('adminoption'). Hope it helps
Problem
I'm making a wordpress plugin. I've used add_query_string() inside anchors in order to load content based on what link the user has clicked. Now I need to know the best way to get the parameter value in the current URI. It's probably a pretty basic and stupid question, but I'm new to programming so I'm sorry if I misinterpret some terms. This is the code: ``` if ( current_user_can('manage_options') ) { echo ( '<div> <ul> <li><a href="'.add_query_arg( 'adminoption', 1 ).'">option 1</a></li> <li><a href="'.add_query_arg( 'adminoption', 2 ).'">option 2</a></li> </ul> </div>' ); // if adminoption == 1 load content A // if adminoption == 2 load content B } ```