Forked from andrewlimaza/redirect_users_to_a_new_page.php
Last active
January 28, 2020 05:09
-
-
Save ipokkel/1bae6b97303f2c2e0ae3afde160ad455 to your computer and use it in GitHub Desktop.
Redirect users away from 'account' page in PMPro if they do not have a membership/logged-in #pmpro #account #redirect #slug
This file contains hidden or 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 | |
/** | |
* Redirect user's to a new URL instead of the 'levels' page in PMPro. | |
* Add this code to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function redirect_users_to_a_new_page( $url ){ | |
return home_url('my-landing-page-slug'); //change this to the page slug you would like to redirect your user's to. | |
} | |
//redirect if users do not have membership level. | |
add_filter( 'pmpro_account_preheader_redirect', 'redirect_users_to_a_new_page' ); | |
//redirect users if they not logged in at all. | |
add_filter( 'pmpro_account_preheader_no_user_redirect', 'redirect_users_to_a_new_page' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment