funnel_id ) && 'thankyou' === $funnel->current_step_data['type']['key'] ) { return; } if ( ! function_exists( 'is_checkout' ) ) { return; } if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) { $order_id = absint( $wp->query_vars['order-received'] ); $order_key = sellkit_htmlspecialchars( INPUT_GET, 'key' ); $order = wc_get_order( $order_id ); $next_step = $order->get_meta( 'sellkit_funnel_next_step_data' ); if ( empty( $next_step ) ) { return; } $next_step_link = add_query_arg( [ 'order-key' => $order_key ], get_permalink( $next_step['page_id'] ) ); wp_safe_redirect( $next_step_link ); } } }