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

actions - How to redirect if a background request is still being executed

programmeradmin1浏览0评论

I am using the Woocommerce Waitlist plugin to allow users to subscribe to product waitlists. After subscribing to a waitlist I want to redirect the user to another page to complete a form. I am using the wcwl_after_add_user_to_waitlist action, which I found in the documentationlike this:

add_action( 'wcwl_after_add_user_to_waitlist', 'redirect_to_waitlist_form', 30, 2);
function redirect_to_waitlist_form( $wc_product, $wp_user ) {
   wp_redirect( '/' );
   exit;
}

The problem is that the page doesn't redirect I guess because something in the background is happening. I can see a pending progress bar on the page and nothing happens.

发布评论

评论列表(0)

  1. 暂无评论