Skip to content

Instantly share code, notes, and snippets.

@woogist
Created January 21, 2015 19:09
Show Gist options
  • Save woogist/bdf6e1e7b8a58915793c to your computer and use it in GitHub Desktop.
Save woogist/bdf6e1e7b8a58915793c to your computer and use it in GitHub Desktop.
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( 'http://www.yoururl.com/your-page/' );
exit;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment