WPML not work in my account page Dashboard Logout
-
I have installed the User Registration and WPML plugin, tranlated my website 2 languages,
in my account page the Dashboard interface some text like:
From your account dashboard you can edit your profile details and edit your password.Not xxx? Sign out
the “Sign out” link always the default language when I switch to another language, I found that problem in the user-registration/templates/myaccount/dashboard.php in line between 89 and 96:
<?php /* translators: 1: user display name 2: logout url */ printf( __( 'Not %1$s? <a href="%2$s">Sign out</a>', 'user-registration' ), '<strong>' . esc_html( $current_user->display_name ) . '</strong>', esc_url( ur_logout_url( ur_get_page_permalink( 'myaccount' ) ) ) ); ?>
Here is the code I changed:
<?php /* translators: 1: user display name 2: logout url */ printf( __( 'Not %1$s? <a href="%2$s">Sign out</a>', 'user-registration' ), '<strong>' . esc_html( $current_user->display_name ) . '</strong>', esc_url( ur_get_endpoint_url( 'user-logout' )) );/* Compatible with WPML */ ?>
Here is the difference:
Before:
esc_url( ur_logout_url( ur_get_page_permalink( ‘myaccount’ ) ) ));After:
esc_url( ur_get_endpoint_url( ‘user-logout’ )) );/* Compatible with WPML */
- The topic ‘WPML not work in my account page Dashboard Logout’ is closed to new replies.