When a user uses the password reset functionality in WordPress, they are asked to enter their email and click confirm. After doing so, they get the message:
Check your email for the confirmation link, then visit the login page.
I wish to modify this message, and I have found the line of code where the message is written in the wp-login.php file:
if ( 'confirm' === $_GET['checkemail'] ) {
$errors->add(
'confirm',
sprintf(
/* translators: %s: Link to the login page. */
__( 'Check your email for the confirmation link, then visit the <a href="%s">login page</a>.' ),
wp_login_url()
),
'message'
);
}
Changing the message there works fine and all, but am I correct in assuming that it would be overwritten as soon as WordPress is updated? If so, my questions are:
Is it possible for me to modify this message with a function that I could put in my theme's functions.php file so that it won't be overwritten by future WP updates?
Can I also have a translation for my new message? If I edit the translation file in the /wp-content/languages folder, I assume it would also be overwritten by an update?