jheske I am having this same problem. Frustrating isn’t it?
Maybe the programmers will fix this issue for us. In the meantime I have an idea for a workaround.
Can you tell me how to make the Sidebar Login work with the page slug as you were talking about in your last post?
We could send people to an internal page using the page slug as you have been doing, then redirect that page using a lightweight redirect plugin like
https://wordpress.org/plugins/speedy-page-redirect
It will take 2 seconds instead of 1 second, and it will take two plugins instead of 1 plugin, but I am hoping it will work good enough until the programmers fix this issue for us.
What are your thoughts?
Hey There –
What we ended up doing (because we needed custom redirects by role) was adding redirect filters in the functions file. Found here: http://codex.wordpress.org/Plugin_API/Filter_Reference/login_redirect
Unfortunately they didn’t work when ajax is used (as in the case of this plugin).
So in order for those to work with this plugin, we added this line to the ajax_handler function, below the existing redirect filter logic –
$redirect_to = apply_filters( 'login_redirect', $redirect_to, null, $user );
It just makes it so the redirect URL can be customized like it can be using the normal login page.
It would be nice if this change was integrated as we really like this plugin.
Not only is there a setting in the widget options to control redirects, there are filters too, such as https://github.com/mikejolley/sidebar-login/blob/master/includes/class-sidebar-login-widget.php#L291 Just filter that and return a valid URL.
In the ajax handler, the value of the redirect URL is always what’s posted from the form. In our scenario, we don’t know where the user should be redirected to until they login and we know who they are (different roles), so we couldn’t set a specific URL in the form post.
The filter we applied is the exact filter WordPress applies on it’s own login form and it would be great if this fix could get rolled into the next version so we don’t have to modify your plugin and stick with your core version (and your updates) and not have a modified one.
Thanks!