Created
July 16, 2019 12:55
-
-
Save eyecandy91/ab7aefe7ce82429fdaa72f1951a4c3be to your computer and use it in GitHub Desktop.
Edit login and user messages
This file contains hidden or 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
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