wp_redirect() function caused endless loading/spinner on WooCommerce Checkout
-
I added wp_redirect() function for logged-in user. Because I want to show them a special page when they logged in.
/* * Logged-in user redirection for special page. */ function login_redirection(){ if ( is_user_logged_in() && is_page(65309)) { wp_redirect('welcome-page/'); exit; } } add_action('wp', 'login_redirection'); /** * when users logged-out, redirect them to login page */ add_action( 'wp_logout', create_function( '', 'wp_redirect(home_url("/login-page"));exit();' ) );
But this code caused endless loading/spinner on the WooCommerce Checkout page.
How can I solve this issue? I need help with this.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘wp_redirect() function caused endless loading/spinner on WooCommerce Checkout’ is closed to new replies.