Title: su Querystring Value
Last modified: February 13, 2017

---

# su Querystring Value

 *  [Martin Blumenfeld](https://wordpress.org/support/users/monkeypress/)
 * (@monkeypress)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/su-querystring-value/)
 * In a previous version of the user list plugin, if I did a search for a user, 
   it would add that search term to the current pages querystring. I was then able
   to user this piece of the referrer URL to redirect back to the filtered list.
   Are you able to add this back in? The only way the SU querystring appears is 
   if I sort the user list after doing a search.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [anmari](https://wordpress.org/support/users/anmari/)
 * (@anmari)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/su-querystring-value/#post-8801274)
 * Hi
    At a quick look here (I’m not at my pc) [http://directories.wpusersplugin.com/simple-user-list/?su=test](http://directories.wpusersplugin.com/simple-user-list/?su=test)
   The query URL still works. Looks like the form action may be a ‘POST’ rather 
   than a ‘GET’ I know some sites had oddities with the REQUEST variable (supposed
   to hold both GET and POST), so it maybe a change a while back around that.
 * For quick fix, You can of course try – have your own little search form with 
   a GET action before the shortcode.
    -  This reply was modified 9 years, 2 months ago by [anmari](https://wordpress.org/support/users/anmari/).
 *  Thread Starter [Martin Blumenfeld](https://wordpress.org/support/users/monkeypress/)
 * (@monkeypress)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/su-querystring-value/#post-8801314)
 * Thanks for the quick reply as always. The su querystring still works. What I 
   was referring to is if I do a search. So go to this page and then enter a search
   filter: [http://directories.wpusersplugin.com/simple-user-list/](http://directories.wpusersplugin.com/simple-user-list/)
 * You’ll see that after you hit submit button the search filter doesn’t get added
   in the pages URL. So it’s doing a post request like you said. It would be great
   if that could be a GET request instead. I think it was that way before, but then
   it changed.
 *  Plugin Author [anmari](https://wordpress.org/support/users/anmari/)
 * (@anmari)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/su-querystring-value/#post-8818982)
 * Hi Martin,
 * Sorry but I’m struggling to understand exactly the use case you describe.
 * You say “referrer URL to redirect back to the filtered list”
 * I understand this to mean someone clicks on one of the search results, which 
   may take them to another page or another view of the data.
    You want to offer
   the user a link on that second page or view to return them to the search results.
   Basically a back button? there are other ways to create a back link or button.
 * Am I missing something?
 * In thinking about this – using a GET on the form will put all the form variables
   in the url – some people have complex filtering and this can look messy, so at
   moment I am disinclined, unless more people request it as necessary and even 
   then might rather have it as not the default.
 *  Thread Starter [Martin Blumenfeld](https://wordpress.org/support/users/monkeypress/)
 * (@monkeypress)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/su-querystring-value/#post-8819007)
 * I use this on a form when I’m editing a users record. So someone clicks on a 
   user record and they go to an edit form. Then on the edit form I store the querystring
   from the user list page so on success, I can redirect them back to the filtered
   search.
 * Now, if I’m on the user list page and I do a search, the su parameter isn’t added
   to the pages url. Now if I click a column heading after doing the initial search
   the ‘su’ parameter then shows up in the querystring of the page. So it almost
   works, it’s just missing the parameter getting added during the first query.
 *  Plugin Author [anmari](https://wordpress.org/support/users/anmari/)
 * (@anmari)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/su-querystring-value/#post-8837425)
 * Sounds like you must be doing this programmatically?
    The su variable should 
   still be in the $_POST variable ? Then you just use [https://developer.wordpress.org/reference/functions/add_query_arg/](https://developer.wordpress.org/reference/functions/add_query_arg/)
 * something like:
    if (!empty( $_POST[‘su’])) $return_url = add_query_arg( ‘su’,
   $_POST[‘su’], $referrer_url );
 * and redirect to the return url (possibly escaped just to be safe)
 *  Plugin Author [anmari](https://wordpress.org/support/users/anmari/)
 * (@anmari)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/su-querystring-value/#post-8837589)
 * Urg! Of course the saving of the variable has to be when you build the link to
   your edit form – pass the ‘su’ along in that link. And then you have it in the
   edit form and use it to build the return URL
 *  Thread Starter [Martin Blumenfeld](https://wordpress.org/support/users/monkeypress/)
 * (@monkeypress)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/su-querystring-value/#post-8838915)
 * Yep, that would work. Am I able to do that within’ the admin somewhere? Or is
   there a custom hook I need to use?

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘su Querystring Value’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/amr-users_f6f6f4.svg)
 * [amr users](https://wordpress.org/plugins/amr-users/)
 * [Support Threads](https://wordpress.org/support/plugin/amr-users/)
 * [Active Topics](https://wordpress.org/support/plugin/amr-users/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amr-users/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amr-users/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Martin Blumenfeld](https://wordpress.org/support/users/monkeypress/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/su-querystring-value/#post-8838915)
 * Status: not resolved