Last active
August 17, 2021 19:55
-
-
Save nextendweb-laszlo/3ecd8f235b1454a63e29e64350329e8c 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 | |
function excludeUrlFromFixedRedirect($fixedRedirectUrl, $provider) { | |
$pageWhereButtonWasClicked = NSL\Persistent\Persistent::get('redirect'); | |
$excluded_url = 'https://example.com/checkout'; | |
if ($pageWhereButtonWasClicked && strpos($pageWhereButtonWasClicked, $excluded_url) !== false) { | |
return false; | |
} | |
return $fixedRedirectUrl; | |
} | |
//excludes the URL from Fixed redirect url - for Login, when login happens with the Google provider | |
add_filter('google_login_redirect_url', 'excludeUrlFromFixedRedirect', 10, 2); | |
//excludes the URL from Fixed redirect url - for Register, when login happens with the Google provider | |
add_filter('google_register_redirect_url', 'excludeUrlFromFixedRedirect', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment