Last active
January 5, 2018 17:23
-
-
Save stuartduff/b06b07035b5be511c21fe2591a211956 to your computer and use it in GitHub Desktop.
This will redirect the customer the referring url on login to WooCommerce.
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
| function wc_custom_login_redirect() { | |
| // This will redirect the customer the referring url on login to WooCommerce.. | |
| $location = $_SERVER['HTTP_REFERER']; | |
| wp_safe_redirect($location); | |
| exit(); | |
| } | |
| add_filter('woocommerce_login_redirect', 'wc_custom_login_redirect'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment