I’m trying to change the login error message text from what it originally reads:
An error has occurred:
You have entered an email address that matches an existing user account in our system. If this is your email address, please log in before continuing your registration. Otherwise, register with a different email address.
I’ve added a function, based on what is on this page, but it doesn’t seem to be working.
%1$sYou have entered an email address that matches an existing user account in our system.%2$sYou can only join the Wait List using your own account or one that does not already exist.%2$sPlease use a different email address.%3$s
Thanks, I added those, but it’s still not working. Here’s my code:
function signuperror_filter_gettext( $translated, $original, $domain ) {
// This is an array of original strings
// and what they should be replaced with
$strings = array(
'%1$sYou have entered an email address that matches an existing user account in our system.%2$sYou can only join the Wait List using your own account or one that does not already exist.%2$sPlease use a different email address.%3$s' => 'Test'
// Add some more strings here
);
// See if the current string is in the $strings array
// If so, replace its translation
if ( isset( $strings[$original] ) ) {
// This accomplishes the same thing as __()
// but without running it through the filter again
$translations = get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}
return $translated;
}
add_filter( 'gettext', 'signuperror_filter_gettext', 10, 3 );
Which specific message are you viewing? Is it in a notice or on the page itself?
There’s actually 2 locations for that string, one if the full string mentioned above and the other is without placeholders.
Try:
$strings = array(
'%1$sYou have entered an email address that matches an existing user account in our system.%2$sYou can only join the Wait List using your own account or one that does not already exist.%2$sPlease use a different email address.%3$s' => 'Test',
'You have entered an email address that matches an existing user account in our system. If this is your email address, please log in before continuing your registration. Otherwise, register with a different email address.' => 'Test 2'
// Add some more strings here
);
In the function above, does you see either ‘Test’ or ‘Test 2’ at all?
Also, where have you added the code? functions.php may be too late in the request so we recommend creating a custom functions plugin to hold functions like these:
Thanks, I was able to get this resolved after reviewing your code.
Viewing 4 reply threads
The support post ‘Change login error message’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.