• Resolved ifwarewp

    (@ifwarewp)


    We wish to redirect users to login page with user email already in the link. The question is if the user email can be URL encoded into the action=magic_login link.
    Example: ../wp-login.php?action=magic_login&[email protected]
    Thank you for the help!

    • This topic was modified 1 year ago by ifwarewp.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Mustafa Uysal

    (@m_uysl)

    Hi @ifwarewp,

    If you are using a custom page with shortcode or block, you can try something like this:

    https://gist.github.com/mustafauysal/b84ced33737a399bda4bb742113bc851

    It should populate to given “email” parameter from query string.

    I hope this helps.

    Thread Starter ifwarewp

    (@ifwarewp)

    Thank you for this detailed and helpful response. Does the file ‘pre-filled-email-with-magic-login.php‘ need to be stored into the ../magic-plugin/includes path?

    Plugin Author Mustafa Uysal

    (@m_uysl)

    Hi @ifwarewp,

    You’re welcome.


    Does the file ‘pre-filled-email-with-magic-login.php‘ need to be stored into the ../magic-plugin/includes path?

    No, please. Don’t update any of the plugins directly because the plugin updates will override the custom modification you made.

    You can copy the snippet and add it to your theme’s functions.php, or you can use the code snippets plugin to add this kind of customization.

    As an alternative, you can always create “mu-plugins” directory under the wp-content and place pre-filled-email-with-magic-login.php there.

    I hope this helps.

    Thread Starter ifwarewp

    (@ifwarewp)

    Hello Mustafa,

    Your immediate availability and dedication to help are greatly appreciated. Both ways, either to add a code snippet to the themes functions.php or alternatively to add the file ‘pre-filled-email-with-magic-login.php‘ to ../mu-plugins didn’t work for me. Not sure how to proceed… Thank you for your help.

    Plugin Author Mustafa Uysal

    (@m_uysl)

    Hi @ifwarewp,

    I may have misunderstood your objective, the code snippet I provided is intended for auto-populating the login form with the specified email address. Are you trying to achieve something else? It would be better if you could explain what you meant by redirection.

    Btw, the snippet was not working on wp-login.php particularly, since the login page uses login_footer hook. (I’ve updated the snippet)

    Thread Starter ifwarewp

    (@ifwarewp)

    Hello again ?? with good news, this time. Your understanding of the goal is correct and it works now. The updated action+function code was placed into the beginning of themes functions.php file. Thank you so much for your excellent help!

    Plugin Author Mustafa Uysal

    (@m_uysl)

    Hi @ifwarewp,

    Delighted to know it’s functioning well for you. If you could spare a moment to share your experience by leaving a review here, that would be wonderful: https://www.ads-software.com/plugins/magic-login/#reviews ??

    Regards,

    Thread Starter ifwarewp

    (@ifwarewp)

    Done! Thank you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to include users email into login page link?’ is closed to new replies.