Problem: I would like to change the following two text strings associated with Toolset's login forms:
1. ERROR: The password you entered for the username **USERNAME** is incorrect.
2. Unknown Error.
Solution: You can use the following function to override the two error messages you mentioned for the login form shortcode:
add_filter( 'gettext', 'tssupp_login_errors', 20, 3 );
function tssupp_login_errors( $translated_text, $text, $domain ) {
// change the text here to customize the messages.
$incorrect_msg = "The information you entered is incorrect.";
$unknown_msg = "There was an unexpected error, please try again.";
// do not edit below this line.
if ( !is_admin() ) {
switch ( $translated_text ) {
case 'The password you entered for the username %s is incorrect.' :
$translated_text = $incorrect_msg;
break;
case 'Unknown error.' :
$translated_text = $unknown_msg;
break;
}
}
return $translated_text;
}