Created
October 3, 2019 20:34
-
-
Save messica/c9ea6df70a8214117e81e5998d150b7b to your computer and use it in GitHub Desktop.
Respect redirect_to query parameter when logging in with Member Homepages
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 my_login_redirect( $redirect, $request, $user ) { | |
if ( ! empty( $request ) ) { | |
remove_filter('login_redirect', 'pmpromh_login_redirect', 10, 3); | |
remove_filter('login_redirect','pmpro_login_redirect', 10, 3); | |
return $redirect; | |
} | |
} | |
add_action( 'login_redirect', 'my_login_redirect', 5, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment