I don’t know anything about the Ultimate Member plugin. But, if http://192.168.100.88/hp1/user/erikamuster is the page you are on then that’s the_permalink(). Looking at it now, I’m not sure it needs to have an action. You could try overriding the search-author.php template in your theme (see the FAQ) and removing the action.
<form method="get" id="sul-searchform" action="">
Let me know if that works as I should probably adjust the plugin. If that doesn’t work, you could also try manually setting the URL you need.
<form method="get" id="sul-searchform" action="http://192.168.100.88/hp1/user/">
I hope that helps!
Thread Starter
dunrar
(@dunrar)
When I make staffoverviewtab my standart tab, an empty action does work though.
I kind of think the action should always be blank. Not sure when I’ll get to test that out, but it might be a good change for a future version. the_permalink() is too restrictive as a URL and will always delete any custom URL args.
Pretty much the exact same issue with pagination, see get_previous_users_url() and get_next_users_url()
You may need to add some allowed search variables via the sul_user_allowed_search_vars filter. Otherwise, the params get removed. I wrote this a few years ago now, and I don’t really know how necessary it is to limit the vars in the way that I am. Like, so what if they are there?
This may help with the search redirection. It may not, I’m not sure yet.
function helga_add_allowed_search_var( $vars ) {
$vars[] = 'profiletab';
return $vars;
}
add_filter( 'sul_user_allowed_search_vars', 'helga_add_allowed_search_var' );
Thread Starter
dunrar
(@dunrar)
Okay, I see. Still, adding allowed search variables did not help me so far. Just pasted your code into the search-author.php, but still got redirected. Any other ideas for allowed search variables? Or in general?
Thanks in advance!
I looked at this today and I think that it is the nature of the GET type of form being used. A GET type form will encode all the inputs into the URL. By default, only the as parameter is an input in the form. Therefore the submit result is always http://192.168.100.88/hp1/user/erikamuster/?as=erik until you add more inputs.
So I *think* you would need to pass a hidden parameter in the form such as
<input type="hidden" name="profiletab" value="staffoverviewtab"/>
to have the resulting URL be http://192.168.100.88/hp1/user/erikamuster/?profiletab=staffoverviewtab/?as=erik
You may need to use PHP to dynamically set that value, I don’t know how the Members tabs work.
Then please give my Dev version of the plugin a try:
https://github.com/helgatheviking/simple-user-listing/tree/dev
I am hoping that fixes the next/prev links. If you could test it on multisite that would be huge, but even testing on a single install will help.
Thread Starter
dunrar
(@dunrar)
Okay, that was it! Thank you very much! Sadly I can try it only on one site, but i’ve tried it with different tabs and it worked. I’ll probably use PHP to set the value of the parameter automatically once I’ve figured out how to get the name of the tab. Haven’t yet hade the chance to try the Dev version or to fix the next/prev links, but once I have, I’ll inform you how it went.
Still, thanks again already!
You’re welcome. Please let me know how the dev version goes.