Last active
March 15, 2016 14:41
-
-
Save amdrew/7f22b058a5defb240c48 to your computer and use it in GitHub Desktop.
OptimizeMember + AffiliateWP. Allow affiliates to login/register and still be redirected to the affiliate area
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
function affwp_custom_op_login_redirect( $return, $vars ) { | |
$user_id = $vars['user_id']; | |
if ( function_exists( 'affwp_is_affiliate' ) && affwp_is_affiliate( $user_id ) ) { | |
$return = false; | |
} | |
return $return; | |
} | |
add_filter( 'ws_plugin__optimizemember_login_redirect', 'affwp_custom_op_login_redirect', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works great! Thank you!