This file contains 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