Last active
January 23, 2017 11:14
-
-
Save mauricerenck/a81a628007bc0ef08df6372f272af210 to your computer and use it in GitHub Desktop.
WooCommerce: edirects for login / logout
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
/*----------------------------------------------------------------------------*/ | |
// edirects for login / logout | |
/*----------------------------------------------------------------------------*/ | |
add_filter('woocommerce_login_redirect', 'login_redirect'); | |
function login_redirect($redirect_to) { | |
$location = $_SERVER['HTTP_REFERER']; | |
wp_safe_redirect($location); | |
exit(); | |
} | |
add_action('wp_logout','logout_redirect'); | |
function logout_redirect(){ | |
$location = $_SERVER['HTTP_REFERER']; | |
wp_safe_redirect($location); | |
exit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment