Skip to content

Instantly share code, notes, and snippets.

@amdrew
Last active March 15, 2016 14:41
Show Gist options
  • Save amdrew/7f22b058a5defb240c48 to your computer and use it in GitHub Desktop.
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
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 );
@ruess
Copy link

ruess commented Mar 15, 2016

Works great! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment