Last active
October 23, 2021 17:21
-
-
Save hamidrezayazdani/7e7c431b62111d76c899cd88d032e67a to your computer and use it in GitHub Desktop.
انتقال کاربر ووکامرس به صفحه قبلی پس از ورود موفق به حساب کاربری
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
<?php | |
/** | |
* Redirect to previous location after login. | |
*/ | |
function ywp_login_redirect( $redirect, $user ) { | |
return $_SERVER['HTTP_REFERER']; | |
} | |
add_filter( 'woocommerce_login_redirect', 'ywp_login_redirect', 1100, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment