Where is the option to ensure they’re being logged in by email address?
We don’t have an option for that, since the plugin is designed to accept both. But you can add frontend enforcement for the form that acceps to email address only with this snippet (assuming you are using shortcode to add magic login form?)
function enqueue_magic_login_email_only_script() {
?>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() {
// Find the form by ID
var form = document.getElementById("magicloginform");
if (form) {
// Find the input field by name within the form
var userLoginInput = form.querySelector("input[name='log']");
if (userLoginInput) {
// Force the input field to accept only email addresses
userLoginInput.setAttribute("type", "email");
userLoginInput.setAttribute("placeholder", "Enter your email address");
}
}
});
</script>
<?php
}
add_action('wp_footer', 'enqueue_magic_login_email_only_script');
And you will probably want to update info message like this:
[magic_login_form info_message="Please enter your email address. You will receive an email message to log in."]
(you can learn more about supported shortcode parameters here: https://handyplugins.co/docs/magic-login-shortcode/)
I’m not sure exactly how DAP works, but it says in the docs as long as they are logged in by email address into WP, it will sync with DAP. DAP has a separate log in system.
This makes more sense now ?? However, I was expecting that they wouldn’t alter the login behavior, especially since they can already retrieve email addresses using the username as well.
-
This reply was modified 2 months, 3 weeks ago by Mustafa Uysal. Reason: added example shortcode with info message
-
This reply was modified 2 months, 3 weeks ago by Mustafa Uysal.