On the default WordPress login page, how do you change the label, "Username", to something else?
I think this is a better alternative to the previous answer.
function login_function() {
add_filter( 'gettext', 'username_change', 20, 3 );
function username_change( $translated_text, $text, $domain )
{
if ($text === 'Username')
{
$translated_text = 'customLoginName';
}
return $translated_text;
}
}
add_action( 'login_head', 'login_function' );
Simple & Short Solution
add_filter( 'gettext', 'register_text' );
function register_text( $translating ) {
$translated = str_ireplace( 'Username or Email Address', 'Your Custom Text', $translating );
return $translated;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With