Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ideadude/1440a2945fa7e0e347c3e6a52a0bb65c to your computer and use it in GitHub Desktop.
Save ideadude/1440a2945fa7e0e347c3e6a52a0bb65c to your computer and use it in GitHub Desktop.
Redirect to the membership account page instead of the home page after email validation with the PMPro Email Confirmation add on.
/**
* Redirect to the membership account page instead of the home page after email validation with the PMPro Email Confirmation add on.
* Add this code to a custom WordPress plugin. https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmproec_after_validate_user() {
if( is_user_logged_in() ) {
wp_safe_redirect( '/membership-account/' );
} else {
wp_safe_redirect( wp_login_url( '/membership-account/' ) );
}
exit;
}
add_action( 'pmproec_after_validate_user', 'my_pmproec_after_validate_user' );
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Redirect to the Membership Account Page after Email Confirmation" at Paid Memberships Pro here: https://www.paidmembershipspro.com/redirect-to-the-membership-account-page-after-email-confirmation/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment