Skip to content

Instantly share code, notes, and snippets.

@adamcapriola
Last active January 26, 2019 21:39
Show Gist options
  • Save adamcapriola/58e3b1cd4050e6a74131d92ed3ca2819 to your computer and use it in GitHub Desktop.
Save adamcapriola/58e3b1cd4050e6a74131d92ed3ca2819 to your computer and use it in GitHub Desktop.
Filter WordPress login form labels
<?php
/**
* Filter login form labels
*
* @link https://wpartisan.me/?p=444
*
*/
add_action( 'login_head', 'ac_login_head_form_labels' );
function ac_login_head_form_labels() {
add_filter( 'gettext', 'ac_login_form_labels', 20, 3 );
function ac_login_form_labels( $translated_text, $text, $domain ) {
if ( 'Username or Email Address' === $text ) {
$translated_text = 'Email Address';
}
return $translated_text;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment