Skip Navigation

Resolved

Overview of the issue

Theme My Login is using a custom SQL query to get the ID of the login page. It is expecting only one result, but with WPML enabled it is getting back as many results as languages are enabled.

The problem is that when you try to access the Dashboard, you get redirected to a login page in a random language.

Workaround

As a workaround, you can use tml_page_id filter for translating the page ID to the currently selected language, like this:

add_filter( 'tml_page_id', 'tml_translate_page_id' );
function tml_translate_page_id( $id ) {
	return apply_filters( 'wpml_object_id', $id, 'page', true );
}

6 Responses to “Theme My Login redirects to login page in the wrong language”

  1. Hello, thank you for your post.
    I used tml_page_id filter but this has worked for just 3 hours.
    If you have any advise more, please let me know.
    Nadia