• Thanks very much for a great plugin!

    I am unable to figure out how to redirect to homepage on login and logout. I’ve tried all variations of my site’s url, a / (which works for some plugins), and just leaving the field blank. However, unless I enter a page slug (which my home page doesn’t have), it always redirects to WP default login page.

    Anyone know the correct way to use this feature?

    Thanks very much!

    https://wordpress.org/plugins/sidebar-login/

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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?

    Valice

    (@valicesupport)

    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.

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    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.

    Valice

    (@valicesupport)

    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!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unable to redirect to homepage’ is closed to new replies.