Skip to content

Instantly share code, notes, and snippets.

@stuartduff
Last active January 5, 2018 17:23
Show Gist options
  • Select an option

  • Save stuartduff/b06b07035b5be511c21fe2591a211956 to your computer and use it in GitHub Desktop.

Select an option

Save stuartduff/b06b07035b5be511c21fe2591a211956 to your computer and use it in GitHub Desktop.
This will redirect the customer the referring url on login to WooCommerce.
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