Registration wordpress letter uppercase

Asked

Viewed 112 times

2

How do I prevent customers from registering in wordpress with uppercase email? Some function without plugin?

  • Stephanie understands. It seems that even the character appearing in lowercase inside the input when going to the bank it continues as uppercase... Since you did not answer the question I preferred to delete the answer ok. It looks like you will have to convert the string with JS to lowercase before sending it to the bank

2 answers

1

Hello, if you are using the standard Wordpress registration form, you can use the filter user_registration_email. The same can be added to functions.php of your theme or in a plugin.

function wpes_lowercase_register_email($user_email)
{
    return strtolower($user_email);
}

add_filter('user_registration_email', 'wpes_lowercase_register_email');

0


You can do it this way:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
    $('.email').keyup(function() {

    $(this).val(function(i, val) {
           return val.toLowerCase();
    });

    });
});
</script>

<input type="text" class="email">

I hope it helps!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.