0

I have 2 registration pages, one for Korean, and one for English. The Korean registration is okay. The page /register is redirect to /checkout page. (registration leads to subscription based) after the registration.

On the other hand, the English registration page /register-eng is supposed to redirect to /checkout/?lang=en page. but after the registration, /register-eng also redirects to the same /checkout page.

Is there any apply_filter function to force redirect my English registration page to /checkout/?lang=en page?

Thanks in advance.

Test this code, but failed.

add_filter( 'registration_redirect', 'my_redirect_home' );
function my_redirect_home( $registration_redirect ) {
    global $post;
    $post_slug=$post->post_name;
    if( 'register-eng' === $post_slug ){
        $registration_redirect = 'http://example.com/checkout/?lang=en';
    }
    return $registration_redirect;
}

1 Answer 1

0

If you are using WPML you can use its built-in language condition statement.

if(ICL_LANGUAGE_CODE=='en')

Therefore you can put your redirect function in this.

if(ICL_LANGUAGE_CODE=='en'){
    // Your function
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.