Skip to content

Instantly share code, notes, and snippets.

@himanshuahuja96
Last active August 17, 2019 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save himanshuahuja96/3eae02060ad99bc7bf29257424f12fd2 to your computer and use it in GitHub Desktop.
Save himanshuahuja96/3eae02060ad99bc7bf29257424f12fd2 to your computer and use it in GitHub Desktop.
Theme my login custom error message filter
function myfunctiontoaddmailme($errors){
$withoutLostPassword = '';
if( $errors === '<strong>ERROR</strong>: Invalid username. <a href="https://nicolethemathlady.com/my-account/lost-password/">Lost your password?</a>' ){
$withoutLostPassword = '<strong>ERROR</strong>: Not Sure about the Username?, Then <a href="mailto:nicole@nicolethemathlady.com?subject=Account Issue">Mail Me!</a> ';
$errors = $withoutLostPassword;
}
else if( $errors === '<strong>ERROR</strong>: Invalid email address. <a href="https://nicolethemathlady.com/my-account/lost-password/">Lost your password?</a>' ){
$withoutLostPassword = '<strong>ERROR</strong>: Not Sure about the Email?, Then <a href="mailto:nicole@nicolethemathlady.com?subject=Account Issue">Mail Me!</a> ';
$errors = $withoutLostPassword;
}
return $errors;
}
add_filter( 'login_errors', 'myfunctiontoaddmailme',10,1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment