Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Last active December 17, 2015 16:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredatch/5640639 to your computer and use it in GitHub Desktop.
Save jaredatch/5640639 to your computer and use it in GitHub Desktop.
Customize the login screen text
<?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 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment