I tried this, but it doesn’t work perfectly and doesn’t provide the ability to choose which page the change occurs on. // Additional JS
document.addEventListener("DOMContentLoaded", function() {
var label = document.querySelector('label[for="user_login"]');
if (label) {
label.textContent = "Here is changed text";
}
});
Thank you for sharing your idea with us @chelminski! We have noted this as a feature request and will plan on introducing it as a new feature in LoginPress.
Meanwhile, you can utilize this code to change the labels. Place it at the end of your theme’s functions.php file.
add_filter('gettext', 'custom_login_labels', 20, 3);
function custom_login_labels($translated_text, $text, $domain) {
// Customize the login form labels
if ($translated_text === 'Username or Email Address') {
$translated_text = 'Your Custom Username or Email'; // Change
}
if ($translated_text === 'Password') {
$translated_text = 'Your Custom Password'; // Change Password label
}
if ($translated_text === 'Username') {
$translated_text = 'Choose a Username'; // Change Username label
}
if ($translated_text === 'Email') {
$translated_text = 'Your Email Address'; // Change Email label
}
// Customize the lost password form labels
if ($translated_text === 'Lost your password?') {
$translated_text = 'Forgot your password?'; // Change Lost password link
}
if ($translated_text === 'Reset Password') {
$translated_text = 'Create New Password'; // Change Reset Password button text
}
return $translated_text;
}
Replace the text as you want. I hope this helps!😉 Let me know if you need further assistance.