Created
April 11, 2025 21:52
-
-
Save chikaibeneme/309c2e387e567a22222371e0687836e4 to your computer and use it in GitHub Desktop.
force redirection on order confirmation page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // force redirection on order confirmation page. | |
| add_action( 'wp', 'tec_force_redirect_after_checkout_woo', 1 ,10 ); | |
| function tec_force_redirect_after_checkout_woo(){ | |
| global $wp; | |
| $current_url = home_url(add_query_arg(array(), $wp->request)).'/'.basename($_SERVER['REQUEST_URI']); | |
| if( strpos( $current_url , 'attendee-registration/order-received/') !== false ){ | |
| $url = str_replace('attendee-registration','checkout',$current_url); | |
| wp_redirect($url); | |
| exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment