Forked from strangerstudios/my_pmproec_after_validate_user.php
Last active
April 13, 2021 18:25
-
-
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.
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
/** | |
* 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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/