Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Last active September 12, 2016 15:35
Show Gist options
  • Save pippinsplugins/c6634ef6ee9b65297c85 to your computer and use it in GitHub Desktop.
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
<?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