Skip to content

Instantly share code, notes, and snippets.

@unculturedswine
Created May 24, 2017 15:06
Show Gist options
  • Save unculturedswine/2270a1eee6ffc4abbf738ef0c0d63551 to your computer and use it in GitHub Desktop.
Save unculturedswine/2270a1eee6ffc4abbf738ef0c0d63551 to your computer and use it in GitHub Desktop.
WooCommerce Subscriptions Custom Thank You Page Redirect
add_action( 'template_redirect', 'wc_custom_redirect_after_purchase' );
function wc_custom_redirect_after_purchase() {
global $wp;
if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) {
wp_redirect( '#' );
exit;
}
}
@unculturedswine
Copy link
Author

Add this to your functions.php file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment