Skip to content

Instantly share code, notes, and snippets.

@dwanjuki
Created February 14, 2023 11:47
Show Gist options
  • Save dwanjuki/df8aac472b81f42916d8690dc15ef344 to your computer and use it in GitHub Desktop.
Save dwanjuki/df8aac472b81f42916d8690dc15ef344 to your computer and use it in GitHub Desktop.
Change the PMPro invalid_email error message to something else
<?php
/*
* Change the PMPro invalid_email error text
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_change_invalid_email_error_text( $translated_text, $text, $domain ) {
if ( 'paid-memberships-pro' === $domain ) {
if( $text == "You've entered an invalid email address." ) {
$translated_text = "There is no user account associated with that username or email address."; // Your replacement text
}
}
return $translated_text;
}
add_filter( 'gettext', 'my_pmpro_change_invalid_email_error_text', 20, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment