September 06, 2017
Theme my login can enhance members’ functionality for multi-lingual websites if you use the following snippet to redirect the login form to the appropriate language.
//CHANGE REDIRECT TO LOGIN PAGE BASED ON LANGUAGE - LOST PASSWORD
add_filter('tml_redirect_url', 'my_tml_redirect_lostpassword', 10, 2);
function my_tml_redirect_lostpassword($url, $action){
if ( 'lostpassword' == $action ){
if(ICL_LANGUAGE_CODE=='fr'){ // use the language parameter of your choice
$login_url = site_url('/fr/connexion/', 'https'); // use http if not a secure website
}
else
{
$login_url = site_url('/login/', 'https');// use http if not a secure website
}
//add query arg for checkemail
$login_url = add_query_arg(array('checkemail' => 'confirm'), $login_url);
}
return $login_url ;
}
Additionally, you can use the Theme My Login templates and ICL_LANGUAGE_CODE if statements to translate the plugin further.