How to redirect user to the specific URL and display notice

I want to redirect users upon registration, login, or any operation, to a specific page.If the user does something som

I want to redirect users upon registration, login, or any operation, to a specific page. If the user does something something like click "go back", the displayed notice should disappear.
What function would I use?

add_action('redirectToProfil', array( $this, 'redirectToProfile' )); 

public function redirectToProfile(){
    $url = get_site_url(null, '/profile');
    wp_safe_redirect( $url );
    exit;
}

do_action('redirectToProfil');

I tried using $_GET parameters, but it did not work for me.

SOLUTION

I use $_SESSION[].

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745307018a4621771.html

相关推荐

  • How to redirect user to the specific URL and display notice

    I want to redirect users upon registration, login, or any operation, to a specific page.If the user does something som

    6小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信