Skip to content

Instantly share code, notes, and snippets.

@messica
Created October 3, 2019 20:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save messica/c9ea6df70a8214117e81e5998d150b7b to your computer and use it in GitHub Desktop.
Save messica/c9ea6df70a8214117e81e5998d150b7b to your computer and use it in GitHub Desktop.
Respect redirect_to query parameter when logging in with Member Homepages
<?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