• Resolved TomS Caprice

    (@tomsneddon)


    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 */

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter TomS Caprice

    (@tomsneddon)

    if the user can change the ‘user-logout’ endpoint text, another way to fix
    this:

    Before:
    esc_url( ur_logout_url( ur_get_page_permalink( ‘myaccount’ ) ) )

    After:
    esc_url( ur_logout_url( get_permalink( get_the_ID() ) ) )

    get_permalink( get_the_ID() ) means get current page/post url, if I switch the language to other, the slug of url will auto change, and then ur_logout_url add the endpoint to the end of the url. this will show the correctly url for different languages on my account page Dashboard “Logout” link .

    Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    Hi @tomsneddon,

    Thanks for writing in and for the detailed information with the inputs,

    We have provided all the details to our developer team, they will look into it and include your suggestion if required.

    Regards!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WPML not work in my account page Dashboard Logout’ is closed to new replies.