• Resolved beacondigital

    (@beacondigital)


    Hello,

    I have implemented Ultimate Member on my WordPress site along with WPML, with default language as English and secondary language as French, and 2 user selectable roles. I have created both EN and FR registration forms (independently as they vary slightly), and I am using shortcodes to display the necessary form for each language. Everything works fine leading up to and including the form, but whenever I submit the form, the user is sent to the Custom Redirect URL but without the ?lang=fr tag so the French users see the English confirmation page. To complicate matters, there are 2 roles and each has it’s own Custom Redirect URL.

    I have tried using code found elsewhere, as posted below. While this gets me closer, I need the URL to be that of whatever role the user has selected, so it can’t be a static URL as it is in the attached code.

    Is there a variable available for the Custom Redirect URL available and how can I append the “/?lang=fr” to it? Or is there another way to accomplish what I am after?

    Thank you for your time.

    Glen

    add_action( ‘um_registration_after_auto_login’, ‘custom_register_redirect_secondary_language’ );
    function custom_register_redirect_secondary_language( $user_id ) {

    if( ! function_exists( ‘um_user’ ) )
    return;

    $url_redirect_register = um_user( ‘auto_approve_url’ );

    // check the it’s secondary language
    if( ICL_LANGUAGE_CODE == ‘en’ ) {
    // use custom URL to do the redirect
    $url_redirect_register = ‘https://site.com/en/custom-url-secondary-language/’;
    }

    exit( wp_redirect( $url_redirect_register ) );
    }

    The page I need help with: [log in to see the link]

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

    (@beacondigital)

    I was able to resolve this issue by adding a case selector which used the user role to first define the custom redirect URL and then append “/?lang=FR” if the language is set to French.

    Glen

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @beacondigital

    Thanks for letting us know how you resolve the issue. I am closing this thread now.

    Regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Passing ?lang=fr to Custom Redirect URL’ is closed to new replies.