Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save chikaibeneme/309c2e387e567a22222371e0687836e4 to your computer and use it in GitHub Desktop.

Select an option

Save chikaibeneme/309c2e387e567a22222371e0687836e4 to your computer and use it in GitHub Desktop.
force redirection on order confirmation page
// 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