admin管理员组文章数量:1289508
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 = '/?lang=en';
}
return $registration_redirect;
}
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/checkout/?lang=en';
}
return $registration_redirect;
}
Share
Improve this question
edited Aug 5, 2021 at 14:26
Buttered_Toast
2,8191 gold badge8 silver badges21 bronze badges
asked Jul 24, 2021 at 12:00
Healing for a minuteHealing for a minute
11 bronze badge
1 Answer
Reset to default 0If 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
}
本文标签: Redirect after the registration
版权声明:本文标题:Redirect after the registration 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741398157a2376500.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论