Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eyecandy91/ab7aefe7ce82429fdaa72f1951a4c3be to your computer and use it in GitHub Desktop.
Save eyecandy91/ab7aefe7ce82429fdaa72f1951a4c3be to your computer and use it in GitHub Desktop.
Edit login and user messages
function forgotpass_message() {
$action = $_REQUEST['action'];
if( $action == 'lostpassword' ) {
$message = '<p class="message">Please enter your email address. Then check your email inbox for instructions to reset your password.</p>';
return $message;
}
}
add_filter('login_message', 'forgotpass_message');
The url on the forgot password page includes the query string “action=lostpassword” so that’s what I’m checking for with my $_REQUEST call. If we’re on the forgot password page, then make a new message and return it.
Some other possible values of the action query string (taken from wp-login.php):
logout
retrievepassword
resetpass
rp
register
login
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment