最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to redirect user to the specific URL and display notice

programmeradmin0浏览0评论

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[].

发布评论

评论列表(0)

  1. 暂无评论