This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Customize the login screen text | |
* | |
* Some sites, primarily membership sites, are setup where the usernames ARE their email address. | |
* This is great, but the login screen can confuse users. So help with the confusion, we remove | |
* all references of "Username" on the login screen and replace with "Email". | |
* | |
* @since 1.0.0 | |
*/ | |
function ja_custom_login_text() { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
$("label[for='user_login']").html(function(index, text) { | |
return text.replace("Username or E-mail", "Email Address"); | |
}); | |
$("label[for='user_login']").html(function(index, text) { | |
return text.replace("Username", "Email Address"); | |
}); | |
$("p.message").html(function(index, text) { | |
return text.replace("username or email address", "email address"); | |
}); | |
$("div#login_error").html(function(index, text) { | |
return text.replace("Invalid username", "Invalid email address"); | |
}); | |
}); | |
</script> | |
<?php | |
} | |
add_action( 'login_head', 'ja_custom_login_text', 20 ); |
Questions, comments, or suggestion for improvement? Leave a comment on the GitHub Gist page.