I am using theme my login plugin and want to replace message when people registered and it’s redirect back to login page with displaying message at the top of the form.
Message:
Your registration was successful but you must now confirm your email address before you can log in. Please check your email and click on the link provided.
I want to replace this message.
1 Answer
The below should work as is (with your strings for the new message and the theme’s text domain), when inserted in your theme’s functions.php:
function wpse71032_change_tml_registration_message( $translated_text, $text, $domain ) {
if( $domain === 'theme-my-login' &&
$text === 'Your registration was successful but you must now confirm your email address before you can log in. Please check your email and click on the link provided.'
) {
/* in the below, change the first argument to the message you want
and the second argument to your theme's textdomain */
$translated_text = __( '%Registration Message%', 'theme_text_domain' );
}
return $translated_text;
}
add_filter( 'gettext', 'wpse71032_change_tml_registration_message', 20, 3 );
See the article on the gettext filter in the Filter Reference.