WordPress.org

Ready to get started?Download WordPress

Forums

WP-Members
[resolved] redirect to email link after login (4 posts)

  1. JuniperPaul
    Member
    Posted 10 months ago #

    Situation: A website member (registered but not logged in) receives an email containing a link to a page that's accessible only to logged-in members. They click on the link and get the WP-Members login page. They log in, but are not automatically redirected to the page they originally requested.

    I've played with add_filter( 'wpmem_login_redirect', fn) and it works fine for known addresses, but I can't find that original email link in memory. I had hoped to find it in HTTP_REFERER but that contains only the URL of the login page itself! And it's not stored in a cookie.

    Is there a hook I can use to set the redirect URI immediately after the plugin code actives and before that initially requested URI is lost?

    http://wordpress.org/plugins/wp-members/

  2. Chad Butler
    Member
    Plugin Author

    Posted 9 months ago #

    Or you could put that link in the email with the [reglink] shortcode (see: http://rocketgeek.com/plugins/wp-members/users-guide/customizing-emails/email-shortcodes/). That way they can login on the page they originally requested.

  3. JuniperPaul
    Member
    Posted 9 months ago #

    Thanks, I'll try that. (A usage example would be helpful if you have a minute.)

    (For the benefit of future readers, that documentation link is http://rocketgeek.com/plugins/wp-members/users-guide/customizing-emails/email-shortcodes/ without the close-paren.)

  4. Chad Butler
    Member
    Plugin Author

    Posted 9 months ago #

    I guess I assumed an example was not necessary since that particular shortcode is included in the default email content that loads when you install the plugin. But if that wasn't the case for you, it is just a matter of adding that shortcode in your email - its output is the link that the user registered on.

    So this:

    You may sign in and continue reading here:
    [reglink]

    would output this:

    You may sign in and continue reading here:
    http://yoursite.com/category/some-post/

    Hope that helps.

Reply

You must log in to post.

About this Plugin

About this Topic