Last active
November 24, 2022 17:27
-
-
Save UltraSimplified/8ad1d1ca8ae57f3a7396cae16e247219 to your computer and use it in GitHub Desktop.
Override the standard WordPress password messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Change the password reset text | |
* | |
**/ | |
function change_password_reset_text_filter( $translated_text, $untranslated_text, $domain ) { | |
switch( $untranslated_text ) { | |
case 'Enter your new password below.': | |
$translated_text = __( 'A system generated password has been created for you. If you wish to use this, please make sure you store it somewhere safe.','text_domain' ); | |
break; | |
case 'New password': | |
$translated_text = __( '<h3>Password</h3>To change this to something more personal and memorable, please type a new password in the box below.<br/><br/>','text_domain' ); | |
break; | |
case 'Hint: The password should be at least twelve characters long. To make it stronger, use upper and lower case letters, numbers, and symbols like ! " ? $ % ^ & ).': | |
case 'Hint: The password should be at least twelve characters long. To make it stronger, use upper and lower case letters, numbers, and symbols like ! \" ? $ % ^ & ).': | |
$translated_text = __( 'Please click Set Password when you are ready.<br/><br/>You will always be asked to enter your username and password when entering the site.','text_domain' ); | |
break; | |
case 'Reset Password': | |
$translated_text = __( 'Set Password','text_domain' ); | |
break; | |
case 'Your password has been reset.': | |
$translated_text = __( 'Your password has been set.' ); | |
break; | |
case 'Lost your password?': | |
$translated_text = __( 'Click here to reset your password' ); | |
break; | |
} | |
return $translated_text; | |
} | |
add_filter('gettext', 'change_password_reset_text_filter', 20, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wow....This is amazing. Tipping my had to the people who made this.