Last active
September 12, 2016 15:35
-
-
Save pippinsplugins/c6634ef6ee9b65297c85 to your computer and use it in GitHub Desktop.
Redirect users to specific pages when logging in based on their status in Restrict Content Pro
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 pw_rcp_login_redirect( $redirect_to, $request, $user ) { | |
$status = rcp_get_status( $user->ID ); | |
switch( $status ) { | |
case 'expired' : | |
case 'pending' : | |
case 'free' : | |
case 'cancelled' : | |
$redirect_to = 'http://yoursite.com/renewal-page'; | |
break; | |
case 'active' : | |
// if you want, set a rredirect here as well | |
break; | |
} | |
return $redirect_to; | |
} | |
add_filter( 'login_redirect', 'pw_rcp_login_redirect', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment