• Resolved chelminski

    (@chelminski)


    Please add a function to change the label in the login form on the pages:

    • password reset,
    • login,
    • registration.

    Allow to add your own text instead of the current one. Why is it worth it?

    • possibility of personalization (e.g. “Player name” instead of “Login or e-mail address”)
    • better compatibility with css (e.g. when the text “Login or e-mail address” is too long, you can replace it with something else, e.g. “login”)

    Greetings

    chelminski ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter chelminski

    (@chelminski)

    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";
    }
    });
    Plugin Support Emma

    (@emma24)

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.