Last active
December 5, 2017 15:42
-
-
Save DanielSantoro/248985e637abeb2a8bbc124360671777 to your computer and use it in GitHub Desktop.
Redirect Thank You Page
This file contains 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
<?php | |
/** | |
* Redirects Thank You page after checkout in WooCommerce | |
*/ | |
add_action( 'template_redirect', 'wc_redirect_post_checkout' ); | |
function wc_redirect_post_checkout() { | |
global $wp; | |
if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) { | |
wp_redirect( 'http://example.com' ); | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment